473,386 Members | 1,860 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,386 software developers and data experts.

Client-Side Scripting - Drop Down List

When users select from a DropDownList, I'd like to have the selected value
get copied to a TextBox also on the same page.

1. How do I wire up a client-side JavaScript function call to a DropDownList
control so that the function gets called when the user makes a selection?
This DropDownList will be a server control because it gets populated
server-side.
2. What is the syntax I need to use in the client-side function that will
retrieve the value selected from the DDL?

Thanks!
Nov 19 '05 #1
4 1262
Have ou tried the YourDropDownList_SelectedIndexChanged method with
AutoPostBack True?

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #2
That won't help... I need for *client-side* function to be called.
AutoPostBack would work if I needed a server-side function to be called.
"Patrick Olurotimi Ige" <na********@hotmail.com> wrote in message
news:Oi**************@tk2msftngp13.phx.gbl...
Have ou tried the YourDropDownList_SelectedIndexChanged method with
AutoPostBack True?

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #3
1&2: Put this tag
oncheck="txtBox.value=this.options[this.selectedIndex].value"
in your ddl definition in the html view.

Alternatively you can use it in the code (c#):
MyDdl.Attributes["onclick"] =
"txtBox.value=this.options[this.selectedIndex].value";

Eliyahu

"Jeremy S" <A@B.COM> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
When users select from a DropDownList, I'd like to have the selected value
get copied to a TextBox also on the same page.

1. How do I wire up a client-side JavaScript function call to a DropDownList control so that the function gets called when the user makes a selection?
This DropDownList will be a server control because it gets populated
server-side.
2. What is the syntax I need to use in the client-side function that will
retrieve the value selected from the DDL?

Thanks!

Nov 19 '05 #4
Thank you very much! I'll give it a whirl.

-JS
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:e8**************@TK2MSFTNGP14.phx.gbl...
1&2: Put this tag
oncheck="txtBox.value=this.options[this.selectedIndex].value"
in your ddl definition in the html view.

Alternatively you can use it in the code (c#):
MyDdl.Attributes["onclick"] =
"txtBox.value=this.options[this.selectedIndex].value";

Eliyahu

"Jeremy S" <A@B.COM> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
When users select from a DropDownList, I'd like to have the selected
value
get copied to a TextBox also on the same page.

1. How do I wire up a client-side JavaScript function call to a

DropDownList
control so that the function gets called when the user makes a selection?
This DropDownList will be a server control because it gets populated
server-side.
2. What is the syntax I need to use in the client-side function that will
retrieve the value selected from the DDL?

Thanks!


Nov 19 '05 #5

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

Similar topics

15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
2
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
0
by: Harley | last post by:
Hello, I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and...
8
by: Ankit Aneja | last post by:
i am doing here some some socket-client work in C# windows service it is working fine for multiple clients now i want to limit these multiple clients to 25 for example i want that when service...
2
by: Delmar | last post by:
I need to build Web Application that will generate a client to execute some operations. Each client has running silent application. Maybe somebody can advice me what can I do ? Thank you.
14
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
0
by: khu84 | last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output. Following is the server code:- <?php function...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.