I have a table containing a list of unique values in the second column. There is an input field to add a new row onto the field, but before inserting the row, I want to validate that the particular field value does not already exists in the table.
In my on-click event, I have tried the following:
if ($('#tablename tr > td:contains('+VALUE+')').length!=0)
{
alert("Please enter a unique row number.");
}
The problem with this is that it does not limit to a certain column, so if I enter a value that exists in any other cell of the table, it displays the alert. How can I restrict it to searching for an exact match, and only in the second column.
THanks!