|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||||||
|
||||||||
|
Prevent Duplicate Entries...
I have a form select object that loads the options from my database. The code for it as follows:
php Code:
I also have a text input as follows: php Code:
What I want to do is have JavaScript check all the current names for the select object and if any of them match what has been entered in the form input, for an error message to be displayed and focus back to the form input. Any help would be appreciated. |
|
#2
|
||||
|
||||
|
RE: Prevent Duplicate Entries...
if you want javascript to do this you need to load all the existing entries for the select box into a javascript array.
I would do a query at the top of the page and pull all the entries and store them in an array, then write a javascript function to validate the text area usuing a for loop to populate the array with php variables. then the same php array can be used to create your list box without making another query |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Prevent Duplicate Entries... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|