function changeSelects() {$('[EMAIL PROTECTED]"submit"]', this.form).remove();
$(".selectsubmit").each(function(){
// search for submit button and remove him //
console.log( $(this).parent().attr('name') );this.form.submit();
// set onchange event handler for select //
$(this).change(function(){
// submit form //
});
});
}
Every form element has a property called "form", which is a reference to the form element they are contained in.
$(this).parent().submit(); // why does not work when i get
right console.log output of the form name ?
The reason for that, IIRC, is that $("foo").submit() (and others like it -- click(), etc), triggers a "fake" submit event. All of the "submit" event handlers are fired as if a form submission had actually occured, but the submit method on your form element is never actually called (although I believe there was talk of adding this in).
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
