Yeah, that's actually where I found my answer Klaus. I'm a bit embarrassed that I basically posted the question a second time. It didn't immediately occur to me that I could do the same thing with "input:type" that I could with ".classA". I'm not a css stud so I guess I didn't think of the index:type syntax as being a css selector... what I did think it was, I have no idea. :o'

Well, I appreciate everyone's patience with me.

The upshot of all this is that I managed to condense what would have taken at least one-hundred lines of code down to only three... well one really, except that I like to split things out on to separate lines. The idea was to gather all the form fields and put their values in an object such that I could pass all the variables in one single structure. Here's what I ended up with:

               var obj = new Object;
               // all inputs of type text, hidden, select and textarea
$("input:text,input:hidden,select,textarea").each(function(){
                   eval("obj." + this.name + " = '" + this.value + "';");
               });
Very nice. Simple. Clean. Thank you, thank you, thank you jQuery! ... and all you guys who help me with my questions no matter how basic. I am learning, and I use more and more jQuery every day! :o)

Thanks heaps!
Chris

Klaus Hartl wrote:
Christopher Jordan schrieb:
Where is this sort of thing documented? I mean, all the API says (unless I'm missing it somewhere) is that you can do $("input") to get all input elements. It mentions nothing about being able to string them together in a comma delimited list like this.

That's grouping of CSS selectors. I explained that in another response to one of your mails (see subject "A couple of simple questions.") - seems that you have missed that.

Grouping:
http://www.w3.org/TR/CSS21/selector.html#grouping

Selectors:
http://www.w3.org/TR/CSS21/selector.html


- Klaus



This is the sort of thing that would be nice to know, not to have to dig too much to find it... just my .02 I guess. :o)

Cheers,
Chris

Christopher Jordan wrote:
What every happened to this :input selector. It sounded like John put it in
the core, but I can't seem to figure out how to use it. I need to select all
inputs of type text and hidden, as well as all selects and textareas.

Can anyone give me a quick hand with this?

Thanks,
Chris


Jörn Zaefferer wrote:
Hi,

I'd like to have a selector ":input" that selects all input elements of
type text, checkbox, radio and file and all textareas. The jQuery.g object looks like it could be extended to provide this selector, unfortnately I have no idea how to do it.
My approach looks like this:
$.g.[":"].input = "...";
The jQuery.g object is used inside jQuery.filter, which is used by jQuery.select. Both methods are quite complex and undocumeted, I have no idea what is going on in there, therefore I could need some help writing that custom grammar...

-- Jörn

P.S.: Think of dem pupps!

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


--
http://cjordan.info


------------------------------------------------------------------------

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


--
http://cjordan.info

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

Reply via email to