How can I store data keyed in by user from multiple field boxes into a string of data?

45 views Asked by At

HTML:

   <div id="room_fileds">
        <div class='label'>Tickets:</div>
        <div id="content">
            <span>Ticket: <input type="text" style="width:48px;" name="width[]" value="" /></span>

        </div>
    </div>

JS:

function add_fields() {
    var d = document.getElementById("content");

      d.innerHTML += "<br /><span>Ticket: <input 
type='text'style='width:48px;'value='' /></span> ";
}

Hi, I want to insert a string of data into the database through user's input in multiple field boxes

So for example,

When user wants to sell 2 tiers of tickets, the user press the add more button which comes out another field box, with a total of 2 field boxes. And lets say the user sell the 1st tier of ticket at $10 and 2nd tier of ticket at $5, I would want the data to be keyed in to the database as a string 10, 5 in a single variable.

So the database will appear as:

EventID    Ticket Price

   1           10,5
0

There are 0 answers