According to the DOM Level 2 Events Spec, the change event only occurs on input, select and textarea elements. So the correct code would be:

$("#myElement").change(function() {
    this.form.submit();
});
 
Every form element has a "form" property which contains a reference to the form that element is contained in.

--Aaron

On 8/7/06, John Resig <[EMAIL PROTECTED]> wrote:
> $("#myForm").change(function() {
>     $(this).submit() /* is this correct? */
> })

It would actually be:

$("#myForm").change(function(){
    this.submit();
});

since 'this' refers to the form, it's ok just to call the submit
function right on it.

--John

_______________________________________________
jQuery mailing list
[EMAIL PROTECTED]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[EMAIL PROTECTED]
http://jquery.com/discuss/

Reply via email to