471,350 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Textbox value change on select other item dropdownlist

Ok I got form within a c sharp page.

Situation:
On the form I have a drop downliwst and a textbox, the dropdownlist is
populated with products and the textbox has a default vale of the product
price.

Problem:
The first item prce in the dropdownlist is populated in the textbox.
When I select another product from the dropdownlist the value within the
textbox doesn't change to the price of the selected product.

Question:

Can someone tell me how let the textbox value be changed if another item is
selected from the dropdownlist without having to do a postback(which
immediatly submits the form).

Example data loaded in form:
Productname (loaded in dropdownlist) Productprice (loaded in textbox)
Chocolate chips 1,-
Strawberry 0,50

Thank,
A
Jan 8 '06 #1
2 10883
> Can someone tell me how let the textbox value be changed if another item is
selected from the dropdownlist without having to do a postback(which
immediatly submits the form).


You could store the prices into a Javascript array using the
ClientScript object, and set up a client-side event handler (e.g.
OnClientChange) that retrieves the corresponding element from the array
and puts it in the textbox.

[This is really an ASP.NET question, rather than C#, so perhaps post on
microsoft.public.dotnet.framework.aspnet if you have any other
questions that don't follow on from this one]

Jan 9 '06 #2
Moved to microsoft.public.dotnet.framework.aspnet group

Thanks!

"Paul Henderson" <pa***********@pittville.demon.co.uk> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Can someone tell me how let the textbox value be changed if another item
is
selected from the dropdownlist without having to do a postback(which
immediatly submits the form).


You could store the prices into a Javascript array using the
ClientScript object, and set up a client-side event handler (e.g.
OnClientChange) that retrieves the corresponding element from the array
and puts it in the textbox.

[This is really an ASP.NET question, rather than C#, so perhaps post on
microsoft.public.dotnet.framework.aspnet if you have any other
questions that don't follow on from this one]

Jan 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by RockNRoll | last post: by
7 posts views Thread by I am Sam | last post: by
16 posts views Thread by mj.redfox.mj | last post: by

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.