
July 19th, 2005, 11:00 AM
| | | 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. | 
July 19th, 2005, 11:00 AM
| | | Re: select ID in drop down list and show name in text box without clicking submit button
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" <mattloude@hotmail.com> wrote in message
news:%232T5p3t1DHA.4064@tk2msftngp13.phx.gbl...[color=blue]
> 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.
>
>[/color] | 
July 19th, 2005, 11:01 AM
| | | Re: select ID in drop down list and show name in text box without clicking submit button
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:eGUeQ7t1DHA.4060@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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" <mattloude@hotmail.com> wrote in message
> news:%232T5p3t1DHA.4064@tk2msftngp13.phx.gbl...[color=green]
> > 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[/color][/color]
in[color=blue][color=green]
> > the text box, this is easy.
> >
> > But my case is: when the user select the employeeid in drop down list,[/color][/color]
it[color=blue][color=green]
> > 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.
> >
> >[/color]
>
>[/color] | 
July 19th, 2005, 11:01 AM
| | | Re: select ID in drop down list and show name in text box without clicking submit button
<input type="text" value="<%=objRS.Fields.Item(0).Value%>">
Ray at work
"Matthew Louden" <mattloude@hotmail.com> wrote in message
news:eKAWQov1DHA.3656@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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[/color]
javascript[color=blue]
> 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:eGUeQ7t1DHA.4060@TK2MSFTNGP11.phx.gbl...[color=green]
> > 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" <mattloude@hotmail.com> wrote in message
> > news:%232T5p3t1DHA.4064@tk2msftngp13.phx.gbl...[color=darkred]
> > > if the user select the EmployeeID in drop down list, and then click[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > submit button, and it will look up database and show the Employee[/color][/color][/color]
Name[color=blue]
> in[color=green][color=darkred]
> > > the text box, this is easy.
> > >
> > > But my case is: when the user select the employeeid in drop down list,[/color][/color]
> it[color=green][color=darkred]
> > > will
> > > fire the onchange event, and then look up database and show the[/color][/color][/color]
employee[color=blue][color=green][color=darkred]
> > > name in the text box. There is no submit button.
> > >
> > > I really have no idea how to do that.
> > >
> > >[/color]
> >
> >[/color]
>
>[/color] |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|