kraftomatic
09-27-2005, 03:00 PM
Hey Guys,
I'm trying to do this "compare" against a user's input to a particular form field value and wanted to see what would be the best way to do this.
I have a form. In that form there is a field called id_number. When the user enters a number in the field (it will be a 1-3 digit number), I want an onBlur statement to compare it to an array of existing numbers to make sure the user isn't picking one that's already taken.
I'm using a database/ASP page, so I would have a query looking something like:
SELECT id_number FROM tblName;
So I would need to somehow loop through and grab all the existing id's from the db, probably store it in a JS array, then compare it to the form field value and give an error if the numbers match.
Any ideas on how to do this?
Thanks Much!
I'm trying to do this "compare" against a user's input to a particular form field value and wanted to see what would be the best way to do this.
I have a form. In that form there is a field called id_number. When the user enters a number in the field (it will be a 1-3 digit number), I want an onBlur statement to compare it to an array of existing numbers to make sure the user isn't picking one that's already taken.
I'm using a database/ASP page, so I would have a query looking something like:
SELECT id_number FROM tblName;
So I would need to somehow loop through and grab all the existing id's from the db, probably store it in a JS array, then compare it to the form field value and give an error if the numbers match.
Any ideas on how to do this?
Thanks Much!