Hello, I've got this problem where I need to check if one of the radio buttons is checked (true). I have set up a test script and when I do not click on the tested button and then click on the submit the test says that it is true (checked). so here's my code. let me know if you see something wrong...
i have for the form
<form name="frmSearch" method="GET" action="/cgi/search.pl" onSubmit="checkSearch();">
then ill just write here two radio buttons they can only pick one.
<input type="radio" name="destination" checked>blah blah
<input type="radio" name="destination">blah blah
now the javascript
<script language="JavaScript">
function checkSearch()
{
if (document.frmSearch.destination[1].checked == 'true')
{
document.write("true");
return false
}
else
{
document.write("false");
return false //so it won't process.. just for testing
}
}
</script>
i have 14 radio buttons and i need to check if one specific radio button is checked. If so i need to run another type of verification on a textbox.
thanks
hogtied
i have for the form
<form name="frmSearch" method="GET" action="/cgi/search.pl" onSubmit="checkSearch();">
then ill just write here two radio buttons they can only pick one.
<input type="radio" name="destination" checked>blah blah
<input type="radio" name="destination">blah blah
now the javascript
<script language="JavaScript">
function checkSearch()
{
if (document.frmSearch.destination[1].checked == 'true')
{
document.write("true");
return false
}
else
{
document.write("false");
return false //so it won't process.. just for testing
}
}
</script>
i have 14 radio buttons and i need to check if one specific radio button is checked. If so i need to run another type of verification on a textbox.
thanks

hogtied
Comment