I’ve a website where the user have to add as much as he wants <input />, like:
Company: <input type="text" name="company[]" /> Participation: <input type="text" name="participation[]" />
Company: <input type="text" name="company[]" /> Participation: <input type="text" name="participation[]" />
Company: <input type="text" name="company[]" /> Participation: <input type="text" name="participation[]" />
In my PHP backend I check if all works, and I will also use jQuery Validation, but if something go wrong, how can I rewrite this dynamically added forms?
Thank you in advance!!!
I think I got it now. You can recreate the form elements with PHP. You get all the input values in
$companies = $_GET['company']. It contains an array of values.If you want to recreate the form elements, you can loop over this array (assuming you somehow sanitized the input), example: