Hello everyone,

i try to write a really short script that does submit a form if a select
with a certain class is changed. I want it to work also without
javascript so i use a normal form and just put the class to the needed
select tag. Then in $(document).ready i search for that class and change
the form (remove input type="submit" and set onchange event for the
select).

Now my question would be if there are easier shortcuts for forms when
using jquery ? I think i saw a page where the @ and/or the # is used as
selectors. Are there any tutorials on that topic ? i've searched through
jquery.com but can't find something.

$(window).ready(function(){
    changeSelects();
});

function changeSelects() {
    $(".selectsubmit").each(function(){
        // search for submit button and remove him //
        // ... //
        console.log( $(this).parent().attr('name') );

        // set onchange event handler for select //
        $(this).change(function(){
            // submit form //
            $(this).parent().submit();  // why does not work when i get
right console.log output of the form name ?
        });
    });
}

I need a way the get the input type="submit" if i have the form in
$(this).parent(). I don't want to stick another name or class to it so
it's similar to a normal form at start.


best regards,
Truppe Steven

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to