Welcome Guest, Not a member yet? Register   Sign In
dynamic input fields validation in codeigniter
#1

I'm working on a web application that includes a feature to add information of vehicles of users, if a user have more than one vehicle he/she can add those details by "add another" like option. i have main form which has 8 fields.


to duplicate the main form i am using using http://tristandenyer.com/demos/dynamic-form.html script. this script does what i want but the thing is i have no idea how to validate the from fields generated by this script.

by clicking "add section" option the script generates a copy of original form, the field names of form goes as "ID2_first_name" (ID2 mean second copy of original form if the form it goes like ID3_first_name)

ex:
form 2
Code:
<input class="input_fn" type="text" name="ID2_first_name" id="ID2_first_name" value="">

<input class="input_ln" type="text" name="ID2_last_name" id="ID2_last_name" value="">

form 3
Code:
<input class="input_fn" type="text" name="ID3_first_name" id="ID3_first_name" value="">

<input class="input_ln" type="text" name="ID3_last_name" id="ID3_last_name" value="">

....
if a user have 5 vehicles the field of the form named like ID2_first_name.....ID5_first_name.
how can i apply validation rules to these dynamic fields. i am using codeigniter mainly for this.
Reply


Messages In This Thread
dynamic input fields validation in codeigniter - by greenarrow - 07-16-2016, 09:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB