Here's a sample (only tested on IE 5):
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function disable() {
formpointer = document.forms[0]
//alert(formpointer.testcheck.checked);
if ( formpointer.testcheck.checked ) {
formpointer.testtext.disabled = true ;
formpointer.testtext.value = "I am now disabled" ;
} else {
formpointer.testtext.disabled = false ;
formpointer.testtext.value = "No longer disabled am
I" ;
}
}
//-->
</SCRIPT>
<form>
<input type="checkbox" name="testcheck" value=""
onclick="disable()"><br><br>
<input type="text" name="testtext" value="stuff" size="30">
</form>
|-----Original Message-----
|From: Michael Wolter [mailto:[EMAIL PROTECTED]]
|Sent: Thursday, March 01, 2001 9:27 AM
|To: CF-Talk
|Subject: disabling form fields
|
|
|I would like to enable/disable some fields on a cf driven web
|form based
|on the setting of a check box (if you check "use above address" you are
|not able to enter an address below). I played around with some
|javaScript, but could not figure out how to make this happen.
|Any tips or
|sample code would be much appreciated.
|
|Many thanks,
|
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|| Michael Wolter [EMAIL PROTECTED] |
|| Administrative Programmer/Analyst Carlisle, PA 17013 |
|| Dickinson College, Computer Services (717) 245-1527 |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
|Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
|Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists