say your What do you name the variable in your function definition?

function VerifyCode(thisField){
        alert(thisField.name);
}

That should work.

Tim

-----Original Message-----
From: Thane Sherrington [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 9:13 AM
To: CF-Talk
Subject: -OT- Javascript Question


I'm passing a field name to a javascript function like this:
onchange="VerifyCode(this);"

And I want to display the name of the field in the function, like this:

var ErrorMsg="Code is wrong in"+PassedFieldName;
Alert(ErrorMsg);

But when I do that, I get [object] instead of the fieldname.  Is there a 
way to do this?

T 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to