i have a select box to allow the user select what kind of form he need to fill in.
the 2 options are for a single person or someone from a group therefore some of the fieldsets that are in use in the single are switched with some from the group ones.
so for the single user i have this functions: singleinformation, winninginformation, reporterinformation, parentalinformation.
and for the group i have groupinformation, winninginformation, reporterinformation.
in the onsubmit i have another check() function that will check the check box and by the selection will call the right functions
function Check() {
if (document.getElementById("type").value=="s") {
return CheckSingleInformation();
return CheckWinningInformation();
}
else if (document.getElementById("type").value=="g") {
return CheckGroupInformation();
return CheckWinningInformation();
}
}
for some reason, after finishing the first function, if it returned without false it will send the form and not stop at the first error of the second function
what can i do to fix it?
never mind… found the answer 🙂
first i have changed the main function to look like this:
but then i found out it wont stop after the first function so i changed it to be like this
is that the right way?