nope
that ain't it either.
try
// retrieve a form
name from an object
function getFormName( obj )
{
var parent = obj.parentElement;
if ( parent.tagName == 'FORM')
{
var formName = parent.getAttribute('name');
function getFormName( obj )
{
var parent = obj.parentElement;
if ( parent.tagName == 'FORM')
{
var formName = parent.getAttribute('name');
alert(formName);
*********************************************************************
return formName
}
else
{
getFormName( parent );
}
}
return formName
}
else
{
getFormName( parent );
}
}
You'll
see it works, it just won't return the value
Taco
Fleur
0421 851
786
Tell me and I will forget
Show me and I will remember
Teach me and I will learn
Tell me and I will forget
Show me and I will remember
Teach me and I will learn
--------Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Onnis
Sent: Tuesday, 20 January 2004 7:06 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: [OT] Undefined JS - why?try something other than parent cause I would say its reserved--------Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Taco Fleur
Sent: Tuesday, 20 January 2004 6:19 PM
To: CFAussie Mailing List
Subject: [cfaussie] [OT] Undefined JS - why?I can't figure out why the following function keeps returning undefined// retrieve a form name from an object
function getFormName( obj )
{
var parent = obj.parentElement;
if ( parent.tagName == 'FORM')
{
var formName = parent.getAttribute('name');
return formName
}
else
{
getFormName( parent );
}
}While if I put a alert within the function I can see formName is populated with a correct valueAny ideas?Taco Fleur0421 851 786
Tell me and I will forget
Show me and I will remember
Teach me and I will learn---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
