Guest_imported
New member
- Jan 1, 1970
- 0
how can i validate the following radio buttons so that an alert is produced if the values of each button are the same ??
Do you like cricket ?
Yes<input type="radio" name="cricket" value="yes">
No<input type="radio" name="cricket" value="no">
Or softball ?
Yes<input type="radio" name="softball" value="yes">
No<input type="radio" name="softball" value="no">
I want it so that they can only choose yes for question but must answer for both.
Currently script looking like this, makes sure they answer ok, but unable to validate it so that the two fields are different-
if (!(form.cricket[0].checked || form.cricket[1].checked))
{ some function about missing info }
if (!(form.softball[0].checked || form.softball[1].checked)) { some function about missing info}
above works fine
if((form.cricket.value) == (form.softball.value))
above doesn't, any ideas ?????
thanks
Do you like cricket ?
Yes<input type="radio" name="cricket" value="yes">
No<input type="radio" name="cricket" value="no">
Or softball ?
Yes<input type="radio" name="softball" value="yes">
No<input type="radio" name="softball" value="no">
I want it so that they can only choose yes for question but must answer for both.
Currently script looking like this, makes sure they answer ok, but unable to validate it so that the two fields are different-
if (!(form.cricket[0].checked || form.cricket[1].checked))
{ some function about missing info }
if (!(form.softball[0].checked || form.softball[1].checked)) { some function about missing info}
above works fine
if((form.cricket.value) == (form.softball.value))
above doesn't, any ideas ?????
thanks