View Single Post
Old 07-06-2004, 10:09 PM   #3 (permalink)
imaginemn
v7n Mentor
 
imaginemn's Avatar
 
Join Date: 02-18-04
Location: Minneapolis, Minnesota
Posts: 1,940
iTrader: 0 / 0%
imaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to all
Send a message via MSN to imaginemn Send a message via Yahoo to imaginemn Send a message via Skype™ to imaginemn
Try this. Remember that JavaScript starts with 0 and not 1. The form fields are counted in the order they display on the page.

[code:1:2257904064]<html>

<head>

<title>Test Page</title>
<script type="text/javascript">
//<![CDATA[
function disable_all() {
//enter all form fields needed to be disabled
document.forms[0][1].disabled = true;
document.forms[0][3].disabled = true;
}

function toggle(x,y){
if (document.forms[0][x].value == 0) {
document.forms[0][y].disabled = true;
} else {
document.forms[0][y].disabled = false;
}
}
//]]>
</script>
</head>

<body onload="disable_all();">

<form >

<p><input type="text" name="testbox" id="2" size="20" onKeyDown="toggle(0,1);" ><input type="checkbox" name="checkboxtest" id="1" value="ON"></p>
<p><input type="text" name="testbox" id="2" size="20" value="" onKeyDown="toggle(2,3);"><input type="checkbox" name="checkboxtest" id="1" value="ON"></p>
<input type="text">
<input type="submit" name="submit">
</form>

</body>

</html> [/code:1:2257904064]

imaginemn
__________________
Need a project done? - Set Your Own Price!
Imagine Creative Services
- Design : Marketing : Multimedia : More
imaginemn is offline   Reply With Quote