Duncan,
Kill the document.formName. Instead of...
document.formName.obj.value
Just use...
obj.value
Courtney E. Payne, Developer
Fig Leaf Software
"We've got you covered"
[EMAIL PROTECTED]
www.figleaf.com
-----Original Message-----
From: Hays, Duncan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 9:34 AM
To: CF-Talk
Subject: JavaScript 'this' question
I want to be able pass a validated value back to a form without explicitly
assigning the value in JS and I can't figure it out or even whether it can
be done. Something like:
<input type="text" name="field1" value="na"
onChange="javascript:validate(this)">
Then in js have:
function validate(obj){
if (document.formName.obj.value == "field1"){
document.formName.ojb.value = 1;
}
else{
document.formName.obj.value = 2;
}
}
When I do this I get errors saying that "document.formName.obj has no
properties".
Thanks
Duncan Hays
Peace Corps
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]