473,806 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4865
Use client-side code to trigger a reload of the page.

<select onchange="locat ion.href='thisp age.asp?id='+th is.value">
<%

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

Ray at work

"Matthew Louden" <ma*******@hotm ail.com> wrote in message
news:%2******** ********@tk2msf tngp13.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.eventf orm.empname.val ue = objRS("FirstNam e")
please help.

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

<select onchange="locat ion.href='thisp age.asp?id='+th is.value">
<%

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

Ray at work

"Matthew Louden" <ma*******@hotm ail.com> wrote in message
news:%2******** ********@tk2msf tngp13.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*******@hotm ail.com> wrote in message
news:eK******** ******@TK2MSFTN GP11.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.eventf orm.empname.val ue = objRS("FirstNam e")
please help.

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

<select onchange="locat ion.href='thisp age.asp?id='+th is.value">
<%

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

Ray at work

"Matthew Louden" <ma*******@hotm ail.com> wrote in message
news:%2******** ********@tk2msf tngp13.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
7298
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 JavaScript showempname(), and it will then look up the name by executing SQL statement. However, the following code has the following error: Microsoft VBScript runtime (0x800A01A8) Object required on line " sqlStmt = "select * from employee where...
3
1836
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 me
4
4402
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. When an option is selected in the 2nd select list, the ASP page posts itself. Assume that the 1st select list has the following 10 options (note that both the select lists are actually populated from 2 different database tables): Australia
4
22142
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 to solve is that the designer would like to limit the total number of entires shown when you click on the drop-down arrow of a select box. I'm starting to think that this isn't possible. I've tried the following with no luck:
1
2777
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 additions and hence might grow longer. So i would like the user to key in the values directly. So i have a text box and a button next to it on clicking which a dropdown appears. The user can directly enter the value in the text box or select one from the...
3
1774
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 email of information to me fine. everything comes through apart from the option they've chosen from the drop down box. the code i have is the following; <form action="mail.php" method="post"> <input onfocus="this.select()" name="name"...
2
1676
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 specific site. Also he has the option to check a checkbox "Remeber this choice" so that when he returns to the site it remembers what he has choosen from the drop down list and automatically takes him to a specific site. Here is my code:
6
7576
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 the problem that when I went to select the other drop down menus, the selections i made on the multiple select one would clear. Then I had tried putting the multiple select menu last so that the selections wouldn't clear but then after clicking the...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10624
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.