• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Form Input Box to validate a producer code and open a page on my website

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, First of all Thank you to all that have taken the time to help me out as I haven't written a line of code for 10 years.

I am going to to try and be as specific as possible with this post as to what I am trying to accomplish.

My site: http://www.madison.k12.sd.us/mms/club7/RastelliRancher/default.htm

the site is a project site that allows consumers to track their beef that they bought back to the rancher up to 6 different ranchers. The ground beef would have a producer code on it. example code 123456, 654321, 213456, 456123, 543216, 321456.

If the consumer enters the correct producer code it will bring up that ranchers bio page that i have created on my site. If a user enters an invalid code it will go to a different page stating "invalid producer code" or it could be an error message.

I hope that is clear, because it is as clear as i can make it. Thanks for all your help.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am on a super fast connection and that header image took forever to load. Shrink down that file size since it is (1468716 bytes). Yikes!




Eric
 
jared peterreins
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I just send you the side menu as i am not one bit sure about code?
the page a good code would to would be Ranch 1.htm , Ranch 2.htm, Ranch 3.htm, Ranch 4.htm, and so on up to 6

Thanks as i don't understand any of that
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jared peterreins wrote:...i don't understand any of that


The JavaScript function Eric suggested would be called by your submit button (for example, onclick="go()").

Essentially, that function gets your text box element (using an id that you need to assign in your HTML), and retrieves the value input by the user. It uses that value to determine which page to load. (If the user's input is not defined, then it uses "badCode.html" as a safety net.)

If you're not familiar with JavaScript, see W3 Schools - JavaScript Tutorial.
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic