Welcome Guest, Not a member yet? Register   Sign In
Jquery multi-line form
#1

[eluser]bohara[/eluser]
Hello,
I am trying to move a rails app over to ci. I need to create a form that allows users to add line items to the form and then submit it the the database.

The form will initially display one line item, and then I would have a link below that says "Add another" This would insert another row of the form items below the first, and could be repeated for as many as needed by the user.

In rails this is done using partials, so I split that portion of the form into its own view. I just don't know how do add it dynamically using jquery. I can only see How to include HTML, and what I need to insert looks like this:
Code:
<fieldset>
    &lt;?$this->load->view("reminders/line_item");?&gt;
    <div id="row">**Insert next line here</div>
</fieldset>
        
<p><a href="#">Add another</a></p>


My other question is how to set the line items to be inserted via the controller. Does each line need a unique ID, or can I just loop over the results on insert.

Hope this makes sense.
Thanks in advance for any help on this.


Messages In This Thread
Jquery multi-line form - by El Forum - 03-15-2008, 08:28 AM
Jquery multi-line form - by El Forum - 03-16-2008, 01:09 PM
Jquery multi-line form - by El Forum - 03-18-2008, 01:12 PM
Jquery multi-line form - by El Forum - 03-18-2008, 01:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB