Jump to content

[SOLVED] form validation


adam291086

Recommended Posts

<script language="javascript">
function checker(val)
{
if (val == "Yes")
{
document.getElementById('negative').checked = false;
document.getElementById('question2').style.display='block';
}
else if (val == "No")
{
document.getElementById('positive').checked = false;
document.getElementById('question2').style.display='none';
}
}
</script>

Is this the first question you have ever answered?<br><br>

<input type="radio" onclick="checker(this.value)" id="positive" value="Yes">Yes
<input type="radio" onclick="checker(this.value)" id="negative" value="No">No

<br><br>

<span id="question2" style="display:none">
Add your second question here.........
</span>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.