Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:00 AM
Matthew Louden
Guest
 
Posts: n/a
Default 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.


  #2  
Old July 19th, 2005, 11:00 AM
Ray at
Guest
 
Posts: n/a
Default 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]


  #3  
Old July 19th, 2005, 11:01 AM
Matthew Louden
Guest
 
Posts: n/a
Default 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]


  #4  
Old July 19th, 2005, 11:01 AM
Ray at
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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.
Post your question now . . .
It's fast and it's free

Popular Articles