How To Determine The Parent Form Element Of An Input
erics, Posted April 14th, 2011 at 1:07:30pm
Original Post: http://stackoverflow.com/questions/991367/how-to-get-the-form-parent-of-an-input
Native DOM elements that are inputs also have a form attribute that points to the form they belong to:
var Form = element.form;
alert(jQuery(Form).attr('name'));
Use the jQuery closest() function for NON-INPUT elements:
var $form = jQuery(element).closest('form');
alert($form.attr('name'));
Another cool post:
http://stackoverflow.com/questions/311579/jquery-js-how-do-i-select-the-parent-form-based-on-which-submit-button-is-clic
Leave Your Comment
All fields marked with "*" are required.