[jQuery] Re: Newb question about accessing a form's inputs

2009-02-07 Thread Kevin Dalman
Unless jQuery 1.3 has made vast improvement in the "name=Xxx" functionality, it is *horrendously slow*! I use a custom function to access form-fields - $F("fieldName") - which is up to 1000-times faster on large pages in my web-application. But this method is dependant on other custom methods, so

[jQuery] Re: Newb question about accessing a form's inputs

2009-02-06 Thread james
Beauty. That's what I was looking for. And thanks to the point to the docs. On Feb 6, 4:09 pm, sem101 wrote: > Always give your elements id's (instead of name values) -- or at least > a class attribute, so they can be targeted. (You can target name > values, but it's a bit more work.) > > Exa

[jQuery] Re: Newb question about accessing a form's inputs

2009-02-06 Thread James
Without using IDs, you can use: var myVar = $("input[name=myHiddenInput]").val(); On Feb 6, 10:54 am, james wrote: > Hi, > > If I have a form: > > onsubmit="javascript:doStuff()"> >     >     >     > > > What is the equivalent JQuery syntax for the following? > > function doStuff() { >    

[jQuery] Re: Newb question about accessing a form's inputs

2009-02-06 Thread sem101
Always give your elements id's (instead of name values) -- or at least a class attribute, so they can be targeted. (You can target name values, but it's a bit more work.) Examples: var myHiddenInput = $('#myHiddenInput').val(); var myNonHiddenText = $('#myNonHiddenText').val(); $("form#myFor