Please help me in creating a script that will show the hidden textbox if a checkbox is checked..
I don't have any idea on how to do this.
Thanks in advance..
I'm pretty sure you can find this code on the internet. The purpose of the DaniWeb Forum is to help people who are stuck with a programming problem and are not able to solve it. Try solving this problem yourself and if you get stuck, we are here to help you out. We will not however, do the code for you.
Here is a start...
Here you go, This will show a Input[text] if you check the checkbox.
if (chk.checked == 1)
alert("You didn't check it! Let me check it for you.")
chk.checked = 1;
<input type="text" value="hey" style="display:none"><input oncheck="validate(this.id)" type="check">
// It might not be oncheck im just guessing off top of my head.
s.gotactics, I'm pretty sure you mean well but your code will not work for 2 reasons.
1. You need to add in
id="Texttoshow" to the input field.
2. There is no onCheck event in JS, Use onclick.
<input type="hidden" value="x" id="x" name="x"/> <input type="checkbox" onclick="document.getElementById('x').type='text'" />