You are here:

DHTML/Form Validation

Advertisement


Question
Hi Ernesto,
I work with Dreamweaver and have used it's form validation feature which works fine but it a quite limited. What I have is a form that has questions with multichoice answers which are selected by clicking a radio button. On submitting I want the user to be prompted to "try again" on questions they have not answered correctly. ie The form will not be submitted until all the questions are answered correctly. (It's a learning thing more than a test)Is there an easy way to this or do I need some complex programing done?
Thanks
Richard  

Answer
Hi Richard
Yes, you do need some coding to do that. Hopefully it is not very complex. It is done with javascript. However, you should write this code by yourself since I donīt know how Dreamweaver can help it.
The things works like this: You start trapping the act of submitting the form using the javascript onsubmit event. When this event occurs a validation routine takes places looking for wrong answers from the user. In that case the form is not validated showing the user the need for a "try again" action.
You can find a lot of detail explanations, tutorials and ready to copy code using the words [javascript onsubmit form validation] in your search at google.

DHTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Ernesto de Lara

Expertise

web site design, web pages and banners design, html, dhtml, javascript, asp, sql, graphics, electronics, analog, integrated circuits and electronic circuits design and manufacturing

Experience


Past/Present clients
mexican customers

©2012 About.com, a part of The New York Times Company. All rights reserved.