Click to See Complete Forum and Search --> : disable/enable form


ellicit
04-25-2007, 01:49 AM
Hi,
I need a disable/enable form script


I have this:

<input name="Active_name" type="checkbox" value="">
Click to active name: <br>
<br>
<label>
<select name="names" size="5">
<option value="Jdoe">John Doe</option>
<option value="pkiven">Peter kavin</option>
<option value="Jwillams">Jason Willams</option>
</select>
</label>


What I would like to do is...

I want names (select box) to be disabled by default, but once Active_name (checkbox) is checked... it should enable


thx

mtanti
04-25-2007, 02:19 AM
if by disabled you mean hidden, just make it hidden via css or by using document.getElementById("id of select").style.display = "none" at the onload event of body tag, then put document.getElementById("id of select").style.display = "" at the onchange event of the input tag. If you want to rehide it when the checkbox is unticked you'll want to do a function which takes the value of the checkbox (document.getElementById("id of select").value) as a parameter and then acts appropriately.

ellicit
04-25-2007, 11:35 AM
No, I want it to be disabled... but it should be visible to users... once the check box is clicked.. I want it to enabled.

Thx..

mtanti
04-27-2007, 08:40 AM
What does enabled/disabled mean exactly?

bosko
04-27-2007, 12:14 PM
Try this link:
http://www.google.sk/search?q=disable+form&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:sk:official&client=firefox-a