In choices, there is also a option for "Others", if that clicks a textbox will appear and when un-checks that will disappear. Lets do the same with Javascript.

Put the following code on the header section


code:

function displayField(fieldID, display)
{
document.getElementById(fieldID).style.display = (display) ? 'inline' : 'none';

}



and the following in the body section.


code:

function displayField(fieldID, display)

<input name="checkbox_other" type="checkbox" class="text_background" id="checkbox_other" value="other" onclick="displayField('newClientLbl', this.checked)">
<label style="display:none" id="newClientLbl">

Enter Your Client Type: <input name="newClient" class="text_background" type="text">

0 Response to "others textbox show/hide on checkbox selection"

Post a Comment

Followers

FeedCount

Latest Posts

thecoderinc

Subscribe Now