Afternoon/Morning/Evening all!!
I am currently using some very basic javascript as below to validate form fields:
What I am hoping to do is have the same type of validation on some fields dependant on the value of a drop down. For example if question 3 = Yes then validate questions 4 7 but if question 3 = No then do not validate questions 4 7.HTML Code:<script type="text/javascript"> function validate() { if (document.demo.field_1.value.length < 1) { alert("Please complete question 1"); return false; } if (document.demo.field_2.selectedIndex == 0 ) { alert("Please complete question 2"); return false; } return true; } </script>
If anyone can help me with some javascript that would accomplish this I would be very grateful!
Many thanks
Legs


Reply With Quote

Bookmarks