Also, check the spelling when you do this.

In your initial efforts you had disabled spelled 'diasabled'. Happens to me 
more than I care to admit. ;-)


Guy J. McDowell
[EMAIL PROTECTED]
http://www.guymcdowell.com


>From: Bryan Love <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: RE: Disable form field based on select box
>Date: Thu, 20 Dec 2001 10:39:32 -0800
>
>You'll need this JS function at the top of your page...
>
>function txtDisable( theForm ){
>       cBox = theForm.Contract_Type;
>
>       if( cBox.options[cBox.selectedIndex].value == "Open Hourly" )
>               theForm.Contract_Amount.disabled = true;
>       else
>               theForm.Contract_Amount.disabled = false;
>}
>
>the rest is pretty obvious...
>
><select name="whatever" onChange="txtDisable( this.form );">
>       <option....>
></select>
>
><input type="text"....>
>
>+-----------------------------------------------+
>Bryan Love
>   Macromedia Certified Professional
>   Internet Application Developer
>   Database Analyst
>Telecomunication Systems
>[EMAIL PROTECTED]
>+-----------------------------------------------+
>
>"...'If there must be trouble, let it be in my day, that my child may
>have
>peace'..."
>       - Thomas Paine, The American Crisis
>
>
>
>-----Original Message-----
>From: Paul Ihrig [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, December 20, 2001 10:27 AM
>To: CF-Talk
>Subject: Disable form field based on select box
>
>
>hello all!
>i have a select box called <select name="Contract_Type">
>i would like to Disable a text field called
><input type="text" name="Contract_Amount"
>value="<cfoutput>#DollarFormat(RS_Update_PG2.Contract_Amount)#</cfoutp
>ut>">
>if the selecton in the select box IS
><option value="Open Hourly">
>but leave the text field enable if it is not selected
>
>I have tried this, but it dosnt seem to work
>
><select name="Contract_Type"
>                 onChange="<CFIF value IS "Open Hourly">
><input diasabled type="text" name="Contract_Amount">
><CFELSE>
><input diasabled type="text" name="Contract_Amount"
>value="<cfoutput>#DollarFormat(RS_Update_PG2.Contract_Amount)#</cfoutp
>ut>">
></CFIF>">
>
>
>any help would be great!
>-paul
>
>
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to