How about using a class? I haven't tested it but I believe this is faster than using field names to filter on.
--rob On 5/22/07, Gordon <[EMAIL PROTECTED]> wrote:
I am writing a script that scans a list of items that each contain form fields and doing something based on the value of the field in each item. I came up with the following code, which does seem to work as intended, but execution can take upwards of 500ms, which I feel is rather slow. var container = '#myElem'; $(container.children ()).each (function () { thisVal = parseInt ($('[EMAIL PROTECTED]"quantity"]', this).attr ('value'), 10); // Do stuff }); Obviously the fields can't have the same ID as that would break the validity of the HTML. Field names do not have to be unique so it seemed logical to use them as the basis of selecting the collection of elements to work with.
-- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.