[jQuery] Re: JQuery Form - Ajax - Please HELP ! ! ! ! ! ! !

2009-09-02 Thread Hunts Pointer

Thanks Michael,
your answer helped me solve the problems I was having, if you're in
NYC let me know, I owe you a beer.
- Hunts


[jQuery] Re: JQuery Form - Ajax - Please HELP ! ! ! ! ! ! !

2009-09-02 Thread mkmanning

You could just add name attributes to the text fields (e.g.  ) and then just use data:$('#myForm').serialize().

That will give you a querystring like:
item_01=123&item_02=456&item_03=789 (you can't pass an array to
'data', it expects an object or a string).


On Sep 2, 10:43 am, huntspointer2009  wrote:
> ///Comment:
> Can someone help me do the following:
> create a function that collects ALL of the form's text field's Values,
> along with their corresponding ID, and create an Array like this:
> Example: var dataString = (item_01=123, item_01=456, item_01=789)
>
> then take the 'dataString' Array, and send it to a Server via Ajax,
> whenever I click the 'Submit Button'
>
> Please Note:
> that as new items are created/added to the form,
> the 'Submit Button' must be able to continue submitting the
> 'dataString' Array to server via Ajax
> whenever I click it.
>
> // HTML Code :
> 
>     
>         
>             Item_01
>              value="123"/>
>              class="button_delete"/>
>         
>         
>             Item_02
>              value="456"/>
>              class="button_delete"/>
>         
>         
>             Item_03
>              value="789"/>
>              class="button_delete"/>
>         
>     
>     
> 
>
> // JQuery Code:
> $(document).ready(function(){
>         $('.button_submit').click(function(){
>                         $.ajax({
>                                 type: "POST",
>                                 url: "receive_items.php",
>                                 data: dataString,
>                                 success: function(){
>                                 alert("The Data was successfully sent to 
> server:");
>                                 }
>                         });
>         });
>
> });
>
> - Thank you very much (in Advance)