Click to See Complete Forum and Search --> : Forms with active/inactive check boxes
mbarbu
08-22-2003, 09:33 AM
OK, I'm looking for a script. I have a form with a list of titles. Each title has a check box next to it. Below this list is another list of titles with check boxes.
Here is what I'm looking for. I want the second list to be inactive until a certian check box is checked in the first listing.
If you have a script like this...can I please have a copy.
If you know of a place I can get this script...please do tell.
THANKS
Khalid Ali
08-22-2003, 10:57 AM
you can do something along these lines.
suppose you have a checkbox name="flag" and if this box is checked you wnat to show another element name="phone"
then this is how it will work
if(document.formName.flag.checked){
document.formName.phone.visibility="visible";
}
the above will work if the phone element has visibility set to hidden to begin with.
mbarbu
08-22-2003, 12:27 PM
Tried that and I got an error
Error: document.formName.flag.checked' is null or not an object
mbarbu
08-22-2003, 12:30 PM
This is what I'm currently using and it works for making then disabled checkbox enabled when the "bSoftmed" checkbox is check...but it stays enabled even when I uncheck "bSoftmed".
<form action="_infoprocess-access.asp" method="post" name="AccessForm" id="AccessForm">
<script language="javascript">
function enableField()
{
document.AccessForm.strSoftmedApplications1.disabled=false;
}
</script>
<input type="checkbox" name="bSoftmed" value="1" onClick="this.value=enableField(this.form.strSoftmedApplications1)">
<input disabled="true" type="checkbox" name="strSoftmedApplications1" value="ChartFact-Locator">
</form>