make form fields available depending on user input
I have a form, when a user selcts a radio button such as credit card, check, or PO, certain fields should be available according to which one they select. How do I do this and in what platform?
What you need to do is place all fields, depending on what the user selects, within <div>. In other words, use CSS.
Here is a quick example of what you can do:
<form id="form1" name="form1" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton" onclick="credit.style.display=''; check.style.display='none'" /><br />
<input name="radiobutton" type="radio" value="radiobutton" onclick="credit.style.display='none'; check.style.display=''"/><br />
<div id="credit" style="display:none">
<input name="creditNumber" type="text" />
<div id="check" style="display:none">
<input name="checkRouting" type="text" />
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)