Hello,

i need to find a parent form of an submit button with jquery.

The method

$('#submit').parent("form")

only works when the submit is direct in the form element.
But when I surround the submit element with an div it does not work.

Sample:

This work:
<form action="bla">
 <input type="submit" id="submit" />
</form>

This work not:
<form action="bla">
 <div>
  <input type="submit" id="submit" />
 </div>
</form>

How can I find the form element?

Best Regards
Johannes Geppert

###############
http://www.jgeppert.com

Reply via email to