Beauty. That's what I was looking for.

And thanks to the point to the docs.



On Feb 6, 4:09 pm, sem101 <semiotics...@gmail.com> 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.)
>
> Examples:
>
> <input type="hidden" id="myHiddenInput"  name="myHiddenInput"
> class="attribute1" />
> <input type="text" id="myNonHiddenText" name="myNonHiddenText"
> class="attribute1" />
>
> var myHiddenInput = $('#myHiddenInput').val();
> var myNonHiddenText = $('#myNonHiddenText').val();
>
> $("form#myForm").ajaxForm({
>  url: "myAction.php",
>  type: "POST"
>
> });
>
> http://docs.jquery.com/Valhttp://malsup.com/jquery/form/
>
> On Feb 6, 3:54 pm, james <noahk...@gmail.com> wrote:
>
> > Hi,
>
> > If I have a form:
>
> > <form name="myForm" method="post" action="myAction.php"
> > onsubmit="javascript:doStuff()">
> >     <input type="hidden" name="myHiddenInput"/>
> >     <input type="text" name="myNonHiddenText"/>
> >     <input type="submit" value="submit">
> > </form>
>
> > What is the equivalent JQuery syntax for the following?
>
> > function doStuff() {
> >         document.myForm.myHiddenInput.value = 'some dynamic var';
> >         return true;
>
> > }
>
> > Thanks in advance,
> > James

Reply via email to