I currently have an input form. There are two entries for each input class as follows:
<form>
<input type="text" name="firstname_a" class="firstname" disabled="disabled" />
<input type="text" name="firstname_b" class="firstname" />
<input type="text" name="surname_a" class="surname" disabled="disabled" />
<input type="text" name="surname_b" class="surname" />
<input type="submit" value="submit" />
</form>
On submission I want JQuery to check whether or not value a matches value b (value a has been entered by the end user, value b has been entered by a outworker working for a vetting company). The form could have upto 470 input fields, these are stored in a database dependant upon the type of vetting being carried out. I don't, therefore, want to have to type out 470 times!:
if($('input["name=firstname_a"]').val() == $('input["name=firstname_a"]').val())
{
// do something
}
else
{
// do something else
}
Rather I would like to find a dynamic way to do this, possibly using the serializeArray() function, but I'm struggling! All or any help would be greatly appreciated.