Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java script query

Status
Not open for further replies.

paulcooke

Programmer
Dec 11, 2003
35
0
0
GB
I am new to asp.net so please forgive any stupidity on my behalf but the scenerio is this and could do with answer.

Basically I have got a web form with combo boxes on and depending on the selection by the user I want to show additional controls.

For speed reasons I would like to use javascript to show these controls without going on a round trip back to the server.

How do I achieve this? Any suggestions or links would be gratefully received.

Thanks
 
If you can use JavaScript then you can go right ahead and use it in an ASP.net form. It's not going to break it so just treat it like a normal page.

Can I suggest looking into using JavaScript to set the 'display' style to 'none' or back to 'block' to make it reappear (for a division).

Just remember - even though they won't be able to see the controls they will still be there.

Alot of people will ignore you on this forum if you don't post questions that are of an obviously ASP.net oriented nature. If you get stuck with the JavaScript, post in the JavaScript forum ;)


Yet another unchecked rambling brought to you by:
Oddball
 
paul: You can simply add the javascript attribute to the dropdown, and populate a textbox with values, turn some object to visible, or invisible, etc.

Sounds like you have several combo boxes. To set up the Javascript shouldn't be too hard, there are many examples of code, here at this forum (do a Search in the threads) or over at the Javascript forum.

To add a javascript attribute to the ddl you'd do something like:

ddmyDD.attributes.add("OnChange","doThis();")

Of course there are slight modifications depending on what you are doing. Post some specifics of what you plan to do if you need further assistance.
 
Oddball: Good point, better perhaps to set the style to display="none", I like that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top