Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add to select box

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
hello guys....

a have a select control which contain the list of users. the list i get from user table in oracle database. What i want is when the user type in the box, if the user name is already in the database , it will directly go to the name in the list. if the name is not in the database , it will add the new name user type in into the database.

is it possible to do that?

Thanks so much
NOR
 
Since ASP is server-side, the user will have to submit the form first. It probably is possible using ASP, but there is no HTML control similiar to the VB control you are thinking of. The HTML select box cannot accept values that aren't already an option.

You could have a text box and a select box, and when the user enters a name in the text box, you can use a JavaScript OnChange function call to call a JavaScript function. It should take the value from the textbox (document.formname.textboxname.value) and search through the select box's options and if it finds the right one, make it the selected index, if not, it could check a box saying that it's a new user.

So, basically you need to do this in JavaScript, and just use ASP to input it into the database. I can't remember how to run through Select box indexes, but maybe try the JavaScript forum. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top