Make jquery array out of div

Posted by Industrial on Stack Overflow See other posts from Stack Overflow or by Industrial
Published on 2010-05-04T16:22:21Z Indexed on 2010/05/04 16:28 UTC
Read the original article Hit count: 147

Filed under:
|
|
|

Hi everyone,

Each div with the class "row" is added upon request from the user, to be able to add multiple items at once. So now is the question how I'll collect all the forms in to an array that PHP can read (like JSON for instance). I'll guess that there's already some easy and effective way of doing this?

<div class="container">
    <div class="row">
        <input type="text" name="value1" id="textfield" />
        <input type="text" name="value2" id="textfield" />
        <input type="text" name="value3" id="textfield" />
    </div>

</div>

Here's what I would like to achieve out of the shown example:

array( 
    array ('value1' => '',
           'value2' => '',
           'value3' => '')
);

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about php