954,178 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Processing Checkbox Information From A Form

Greetings,

I maintain a web page for the engineering department where I work and I was trying to make a humorous tool for the web page. Basically it is a form with three categories... Good/Fast/Cheap. Good meaning - a work product that is correct/accurate/etc. Fast meaning on or ahead of schedule. Cheap meaning on or under budget The user would select two of the three "work product" categories using checkboxes and then click on the submit button for the answer. Depending on what they checked would determine the output. If they didnt' check enough categories they would get an answer telling them to select another and resubmit. If they selected all three they would be given an answer indicating they must be in management because they want the job done good, fast and cheap. The truth is you can only have two categories... The work can be done good and fast but it won't be cheap, good and cheap but it won't be fast or fast and cheap but it won't be good. You get the idea.

I'm looking for some help from some javascript "mandarins". I'm struggling trying to figure out how to obtain a value from the checkbox in a form and then using that data with some if statements to output the right answer. Note that I can't use a tag on the corporate server so the form is designated as "all".

Please accept my apologies if the code I have below is garbage - I'm a self taught html programmer and only dabble in javascript (which I find somewhat confusing).

Thanks in advance for any help anyone can provide.

Regards,
Chuck Bruce

Here's what I have (that's currently not working):

[HTML]
Check two of the three options below and then click "Submit"


Good (i.e., accurate/correct/etc.)
Fast (i.e., on/ahead of schedule)
Cheap (i.e., on/under budget)

 







[/HTML]

neophyteprogram
Newbie Poster
2 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

Start by changing your "submit" button to a regular "button". That way when you click the button it won't try to submit the form to a server-side process.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

I was able to get help from a coworkers son on how to get my code to work (there's no way I would have ever figured it out myself!)...

Here it is...

[HTML]
Check two of the three options below and then click the "Process" button.

Good (i.e., accurate/correct/etc.)
Fast (i.e., on/ahead of schedule)
Cheap (i.e., on/under budget)

 






[/HTML]

neophyteprogram
Newbie Poster
2 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You