dgrafx
asked on
get form name
how can I get form name or actually the form object would be fine - either one - from a link?
for example : <a href="" onclick="alert(the name of the form this link resides in); return false;">Click</a>
thanks
for example : <a href="" onclick="alert(the name of the form this link resides in); return false;">Click</a>
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
closest ??? !!!
never heard of it - if it works - awesome!!!
not doubting you - I just can't test it till tomorrow morning ...
thanks - will be in touch ...
never heard of it - if it works - awesome!!!
not doubting you - I just can't test it till tomorrow morning ...
thanks - will be in touch ...
ASKER
Proculopsis - take a look at this please:
https://www.experts-exchange.com/questions/26851013/write-select-multiple-options.html
https://www.experts-exchange.com/questions/26851013/write-select-multiple-options.html
ASKER
you the man ...
ASKER
one final question on this post if youd be so kind ...
You showed me how to get form name or id - which is what I need some of the time.
Other times I need the form object - ya know like if you had a form named myForm then what I mean is document.myForm will give you the parent form object.
how can i get that?
thanks ...
You showed me how to get form name or id - which is what I need some of the time.
Other times I need the form object - ya know like if you had a form named myForm then what I mean is document.myForm will give you the parent form object.
how can i get that?
thanks ...
Just remove the .attr()
var formName = $(this).closest("form").at tr("name") ;
var formObject = $(this).closest("form");
var formName = $(this).closest("form").at
var formObject = $(this).closest("form");
ASKER
hey thanks buddy!
I should have opened a new question - sorry ...
We'll get ya next time!
I should have opened a new question - sorry ...
We'll get ya next time!
No need. Thanks anyway :)
Open in new window
To get the first one (or the only one) : document.getElementsByTagN
Open in new window