Simple JavaScript Problem...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a simple Web Page Questionairre in which questions are read from
a database, and the user can indicate the correct answer via either a
radio input control or a dropdown list.

The number of questions that is displayed on the screen can
vary...depending on the number of questions that satisfy certain

Does anyone have any sample code, or can show me how I can validate
this Web Page in JavaScript so that the user is forced to "answer"
every question on the form (whether it is a radio control or dropdown


Re: Simple JavaScript Problem...

Gazing into my crystal ball I observed writing in

Quoted text here. Click to load it

Not a good idea to rely on client side script to validate a form.  Final
validation should be done server side.  Yes, you can do client side
validation for the user's convience, but make sure that you always check on
the server.

As to your original question, Google is your friend

Adrienne Boswell
Please respond to the group so others can share

Re: Simple JavaScript Problem... wrote:
Quoted text here. Click to load it

I am currently writing pages that require approx. 600 lines of
javascript in addition to the 3-400 lines of struts/html.

To do what you want you will have to have your submit call a validate()
js function which implements the userside logic you want. Obviously, you
will have to implement serverside checking as well, or risk db

Any js primer will tell you how to get/set element values and how to use
the sick (My Opinion) language.

Site Timeline