OK, this is my last attempt to post this response!
.
I just encountered this myself, here is my solution...
The onchange() trigger in the select box calls a function that looks
something like this:
function checkField( theBox ){
boxVal = theBox.options[theBox.selectedIndex].value;
if( boxVal == 1 ){
field1.disabled = false;
field2.disabled = true;
field2.value = "Not Required";
field3.disabled = true;
field3.value = "Not Required";
}
......
}
that only works in IE, so you must also add an onFocus() trigger to each
input field that calls a function that looks something like this to
accomodate Netscape:
function fieldFocus( theBox, theField ){
boxVal = theBox.options[theBox.selectedIndex].value;
[if this is not a required...]
theField.blur();
}
Beware - I've heard that IE6 changed onFocus() and onBlur() to onFocusIn()
and onFocusOut(), but I haven't tried it yet...
+-----------------------------------------------+
Bryan Love
Macromedia Certified Professional
Internet Application Developer
Database Analyst
Telecommunication 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: Bryan Love [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 12:58 PM
To: CF-Talk
Subject: RE: JS Question
oops, I accidentally posted this reply under the wrong subject! Here it is
again...
.
I have a form that, if a user selects a specific item from a select list,
then the next section of the form is grayed out, and the required attributes
are no longer required. I know how to by-pass the required fields using
simple if-else in my JS validation. What I am needing to know is, how would
I go about making the other form elements disable? Does this even make
sense? IS this more of a DHTML thing?
Thanks,
_________________________________________
Bruce Sorge
ICQ#:145050973
Current ICQ status:
SMS: (Send an SMS message to my ICQ): +2783142145050973
More ways to contact me: http://wwp.icq.com/145050973
_________________________________________
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists