I copied an example from the web, but I can't get it to work.
Here is the code.
function CheckForm ()
{
// ** START **
if (document.ClientInfo.x_terms_conditions != "agreed") {
alert( "Please read the Terms and Conditions and agree to it." );
return false;
}
else
return true ;
// ** END **
}
<form name="ClientInfo" action=" method="POST" onsubmit="return CheckForm();">
<tr><td bgcolor="#f0f0f0" class="bodyTEXT2"><input type="radio" name="x_terms_conditions" value="agreed" />I have read and agreed to TicketEddy's Terms and Conditions.</td>
<td bgcolor="#f0f0f0" class="bodyTEXT2"><input type="radio" name="x_terms_conditions" value="declined" CHECKED />I do not agree to TicketEddy's Terms and Conditions.</td></tr>
Whether I click on "agreed" or "declined", I got the alert. If I change the != to ==, I don't get any alert, whether it's "agreed" or "declined." When I tried to print out x_terms_conditions, it says object nodelist.
Help!
Here is the code.
function CheckForm ()
{
// ** START **
if (document.ClientInfo.x_terms_conditions != "agreed") {
alert( "Please read the Terms and Conditions and agree to it." );
return false;
}
else
return true ;
// ** END **
}
<form name="ClientInfo" action=" method="POST" onsubmit="return CheckForm();">
<tr><td bgcolor="#f0f0f0" class="bodyTEXT2"><input type="radio" name="x_terms_conditions" value="agreed" />I have read and agreed to TicketEddy's Terms and Conditions.</td>
<td bgcolor="#f0f0f0" class="bodyTEXT2"><input type="radio" name="x_terms_conditions" value="declined" CHECKED />I do not agree to TicketEddy's Terms and Conditions.</td></tr>
Whether I click on "agreed" or "declined", I got the alert. If I change the != to ==, I don't get any alert, whether it's "agreed" or "declined." When I tried to print out x_terms_conditions, it says object nodelist.
Help!