brndnmg
brndnmg

Reputation: 257

save dynamically created form fields between page requests

I have a form in which the user can dynamically add/remove name/value pairs of fields eg:

inventory list:
[description text input field] [quantity text input field] [remove item button]
[add item button]

so basically the user can add more inventory items:

inventory list:    
[description text input field] [quantity text input field] [remove item button]
[description text input field] [quantity text input field] [remove item button]
[description text input field] [quantity text input field] [remove item button]
[add item button]

ok so what is the easiest way to save the form state if server side field validation fails, or if the user wants to later edit the custom-created form? (i don't think it is of any relevance but I am using JQuery and CakePHP)

Upvotes: 0

Views: 257

Answers (1)

Josh Stodola
Josh Stodola

Reputation: 82513

I think the best way is to use AJAX to make the request, which will prevent the client from having to re-render the entire page.

Upvotes: 2

Related Questions