Click to See Complete Forum and Search --> : Forms


sbedaysee
06-01-2003, 10:40 AM
Dear All,

I am trying to create a form which has a couple of questions where the specific answers requires a specific action. For example:

Question #1

Do you drink:

Milk/Tea/Coffee (these are radio buttons)

If you answer coffee then you need to insert the type of coffee you drink in a text field before progressing to the next question.

Can anyone offer me a script for this as I am stumped and not a prorammer.

The other instance I have a problem with is that I have a question which only allows you to answer Yes/No and hence I have used radio buttons. If you clicked Yes I want the user to then answer Question 6 which again requires the user to make a selection from a choice of 3 radio buttons, but if the user chose No then they must progress to Question 7.

I want these questions to be completed correctly in order to submit the form. Any help would be greatly appreciated!

Kind regards,

Sati.

khalidali63
06-01-2003, 10:53 AM
I think the example at the link below will point you in the right direction

TextBoxFocus.html (http://www.webapplikations.com/pages/html_js/forms/TextBoxFocus.html)

sbedaysee
06-01-2003, 02:50 PM
Many thanks for that. I have come across another piece of code which does the same as this one you have offered me, but the problem I have with both is that although the user is prompted for an answer in the text field if he/she chooses to ignore this prompt the form can still be submitted without an entry in the text field. :(

Do you have any suggestions on how to surmount this problem?

Any advice of my other problem of getting a user directed to the relevant question based on their answer? (see original post for details)?

Many many thanks!

brendandonhue
06-01-2003, 03:32 PM
No, in khalid's script, if you choose other, you must enter something in the text box.

sbedaysee
06-02-2003, 04:10 AM
But when you click other and enter something into the text field and hit process the form does not go anywhere.

How would the user know whether the form has been processed? There was no action applied to the form!

:confused:

brendandonhue
06-04-2003, 03:25 PM
Yea its not a form to submit, as he said, its an example to show how to do what you want. He doesn't know what you want your form to do...how can he write it for you? Hes not doing your web design for you, he showed you how to make a radio button that requires you to enter text.