473,230 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

select ID in drop down list and show name in text box without clicking submit button

if the user select the EmployeeID in drop down list, and then click the
submit button, and it will look up database and show the Employee Name in
the text box, this is easy.

But my case is: when the user select the employeeid in drop down list, it
will
fire the onchange event, and then look up database and show the employee
name in the text box. There is no submit button.

I really have no idea how to do that.
Jul 19 '05 #1
3 4830
Use client-side code to trigger a reload of the page.

<select onchange="location.href='thispage.asp?id='+this.va lue">
<%

Dim iSelectedID, sName
iSelectedID = Request.Querystring("id")
If iSelectedID <> "" Then
sSQL = "SELECT theName FROM theTable WHERE theID=" & iSelectedID"
'etc.
%>

Ray at work

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
if the user select the EmployeeID in drop down list, and then click the
submit button, and it will look up database and show the Employee Name in
the text box, this is easy.

But my case is: when the user select the employeeid in drop down list, it
will
fire the onchange event, and then look up database and show the employee
name in the text box. There is no submit button.

I really have no idea how to do that.

Jul 19 '05 #2
Thanks Ray, Now I am able to get the name corresponding to the id selected
by the user.

But now to put the name printed in the text box? the following is javascript
again, and I put inside <% %> and it wont work.

document.eventform.empname.value = objRS("FirstName")
please help.

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eG**************@TK2MSFTNGP11.phx.gbl...
Use client-side code to trigger a reload of the page.

<select onchange="location.href='thispage.asp?id='+this.va lue">
<%

Dim iSelectedID, sName
iSelectedID = Request.Querystring("id")
If iSelectedID <> "" Then
sSQL = "SELECT theName FROM theTable WHERE theID=" & iSelectedID"
'etc.
%>

Ray at work

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
if the user select the EmployeeID in drop down list, and then click the
submit button, and it will look up database and show the Employee Name in the text box, this is easy.

But my case is: when the user select the employeeid in drop down list, it will
fire the onchange event, and then look up database and show the employee
name in the text box. There is no submit button.

I really have no idea how to do that.


Jul 19 '05 #3
<input type="text" value="<%=objRS.Fields.Item(0).Value%>">

Ray at work

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
Thanks Ray, Now I am able to get the name corresponding to the id selected
by the user.

But now to put the name printed in the text box? the following is javascript again, and I put inside <% %> and it wont work.

document.eventform.empname.value = objRS("FirstName")
please help.

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eG**************@TK2MSFTNGP11.phx.gbl...
Use client-side code to trigger a reload of the page.

<select onchange="location.href='thispage.asp?id='+this.va lue">
<%

Dim iSelectedID, sName
iSelectedID = Request.Querystring("id")
If iSelectedID <> "" Then
sSQL = "SELECT theName FROM theTable WHERE theID=" & iSelectedID"
'etc.
%>

Ray at work

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
if the user select the EmployeeID in drop down list, and then click the submit button, and it will look up database and show the Employee Name
in
the text box, this is easy.

But my case is: when the user select the employeeid in drop down list, it will
fire the onchange event, and then look up database and show the

employee name in the text box. There is no submit button.

I really have no idea how to do that.



Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
The ASP page has a combo box with id list, and when user click the particular id, it will show the name in the text box. My attempt was when the user have event on combo box, it will call...
3
by: slekshmipriya | last post by:
when the user select the employeeid in drop down list, it will fire the onchange event, and then look up database and show the employee name in the text box. There is no submit button. pls help...
4
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. ...
4
by: Matthew Cox | last post by:
Hi, I've been searching the net all day today trying to figure out how one would accomplish what I originally thought would be a fairly straight forward and simple thing. The problem I'm trying...
1
by: ramya2611 | last post by:
hi I have the following scenario.. i have a select box containing a list of times. on selecting one of them i am dispalying all the details pertaining to that selection. the list is prone to...
3
by: jerry101 | last post by:
hi, i've got a form in which the user can fill out consisting of 2 text boxes to enter information in, a drop down box of choices and of course a submit button. when they fill it out, it sends the...
2
by: printline | last post by:
Hi all I have a problem with a form script. The form script should do the following: When a user selects a value from a drop down list and hits the "next" button it should take him to a...
6
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.