I have a PHP page whose purpose is taking user information for job recruitment. This page contains a form which has many input fields. This form is as good as a resume of the candidate.
There is a section in the form where user enters his skill set the format of that section as follows
- skill set dropdown
- skill name dropdown
- proficiency dropdown
- exp. years dropdown
- exp. month dropdown
There are same kind of 8 rows as above. User must fill at least one row in above section. So my question is while submitting the form on above page, is there any way to group that values of the same type in one section to send to action page.
Yes, you need to use an array. If you have a name attribute for each
<select>in a row.like
<select name="proficiency">you can change it to<select name="proficiency[]">to make it an array. Then you can reuse the same name in the array for moreselecttags to add them onto the same array.You could also do all 8 rows of
<select>s as a 2D array like:<select name="skills[name][]"><select name="skills[proficiency][]">etc.