Hi All,
I have a jQuery script that appends a row to a table. In short, the user can select a value from a drop down menu, then enter in 'x' amount of months and hid 'add' which appends the row to the table, for example the following row is appended by the user:
<tr>
<td>Some Value</td
<td>2</td>
</tr>
Now, if the user performs the same operation again, I need to stop the procedure and alert him that he is trying to add a duplicate value. How - using jQuery - can I check to see whether or not the above row already exists, where the first and second <td>
elements have the same value as the data he is trying to add? The reason I say first and second <td>
elements only is because there are other <td>
elements in the row but they house hidden fields which submit the newly added data to to a server side script, so I'd like to keep the validation as short and simple as possible.
If it is of any help, the table id is #tblspecializations
Many thanks for your input.