Hullo,
I am working on sam php code that captures users' details, depending on their choice. If the user selects "No", then the products will not be delivered to him, and so; the form collecting details will not be displayed. However, if he selects "Yes" option, then the form to collect his details will be displayed, and he enters his details. Now, I have been able to do it using a radiobutton, but I want to do it using a select drop down menu, to save me sam space. Here is the code I have been working with;
First, the javascript;
<script type = "text/javascript" language = "Javascript">
function Proof(obj) {
if (document.getElementById('delivery').checked) {
displayValue = "block";
} else {
displayValue = "none";
}
document.getElementById('make_delivery').style.display = displayValue;
}
</script>
Then I have the radiobutton code;
<div align="left">
<input name="delivery" type="radio" id="delivery" tabindex="1" value="yes" onchange="Proof(this);" />
Yes
<input name="delivery" type="radio" id="delivery" tabindex="2" value="no" onchange="Proof(this);" />
No</div>
And then the code for the form capturing user input in case the user selects "yes";
<div id="make_delivery" style="display:none;">
<table width="228" border="0">
<tr>
<td width="72"><div align="left"><strong>Name:</strong></div></td>
<td width="146"><div align="left">
<input type="text" name="uname" id="uname" onblur="MM_validateForm('uname','','R');return document.MM_returnValue"/>
</div></td>
</tr>
<tr>
<td><div align="left"><strong>Location:</strong></div></td>
<td><div align="left">
<input type="text" name="location" id="location" onblur="MM_validateForm('location','','R');return document.MM_returnValue"/>
</div></td>
</tr>
<tr>
<td><div align="left"><strong>Contact:</strong></div></td>
<td><div align="left">
<input type="text" name="contact" maxlength="10" id="contact" onblur="MM_validateForm('contact','','RisNum');return document.MM_returnValue"/>
</div></td>
</tr>
</table>
</div>