The # selector is used for selecting elements based on ID. eg: $("#fooBar") would select all elements with the ID of "fooBar" (even though there should only be one, but whatever)

when @ is used, it is for attribute selectors, for example:

$("[EMAIL PROTECTED]'en']") would select all links with the atribute 'lang' set to 'en', or even just:
$("[EMAIL PROTECTED]"), which would select all links with the 'lang' attribute set.

Check out http://jquery.com/docs/Base/_expression_/ for more info's's

On 10/25/06, Truppe Steven <[EMAIL PROTECTED] > wrote:

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/

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

Reply via email to