Hi Taco,

Try changing the 3rd last line from getFormName( parent ); to "return getFormName( parent );".

Justin

At 06:19 PM 20/01/2004, you wrote:
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 value

Any ideas?

Taco Fleur
Blog <http://www.tacofleur.com/index/blog/>http://www.tacofleur.com/index/blog/
Methodology <http://www.tacofleur.com/index/methodology/>http://www.tacofleur.com/index/methodology/
0421 851 786
Tell me and I will forget
Show me and I will remember
Teach me and I will learn

============================================= Justin Mclean Class Software Phone: (02) 93321230 9 Chapman St Fax: (02) 93321032 Surry Hills Mobile: 0416 119 342 NSW 2010 =============================================



---
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

Reply via email to