Posted by Anonymous Wed 21st Mar 2007 17:15 - Syntax is JavaScript - 29 views
Download | New Post | Modify | Hide line numbers
  1. function getParentForm(obj) {
  2.     //returns form, that is parent of obj.
  3.     //if no parent is form, returns null.
  4.  
  5.     if(!obj.parentNode) {
  6.         return null;
  7.     }
  8.     if( obj.tagName == 'FORM' ) {
  9.         return obj;
  10.     }
  11.     return getParentForm(obj.parentNode);
  12. }

PermaLink to this entry https://pastebin.co.uk/12125
Posted by Anonymous Wed 21st Mar 2007 17:15 - Syntax is JavaScript - 29 views
Download | New Post | Modify | Hide line numbers

 

Comments: 0