Howdy, I tried that first and then as per below, no luck.
Taco Fleur Blog http://www.tacofleur.com/index/blog/ 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 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Justin Mclean > Sent: Tuesday, 20 January 2004 5:42 PM > To: CFAussie Mailing List > Subject: [cfaussie] Re: [OT] Undefined JS - why? > > > 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.co m/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 --- 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
