Amy,
First a quick question. Do you still want the form to post back? If you do
then you don't need to use javascript at all. You can just set the text
box's visible property (not the style) to false and then when the page posts
back to the server check the drop down's value and based on that set the
necessary text box's visible property to true.
If you want to do this without posting back to the server then you'll want
to create a javascript that checks the drop down's value and resets the text
box's style tags appropriately.
To get you started, if the second scenario is what you need, I have some
javascript sample code in the code library of my web site,
www.aboutfortunate.com, that you might find helpful.
Just go to the site and then click the code library link. There is a search
box that you can use to find this sample:
Open web page from drop down list
It will show you how to use javascript to get the value selected in your
drop down list.
I don't have a sample for controlling the style tag of your text boxes but a
google search should turn up many.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
Free code library at:
www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Amy Snyder" <am**@yahoo.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
I have a webform that has a listbox and two textboxes. The style
property of the text boxes are:
style="DISPLAY: none"
Based on the selection made in the listbox, one or both textboxes are
displayed using javascript. The problem comes when I submit the form.
I want the text boxes to stay displayed after submitting the form
because there will be values in them. How can I do this with .NET /
JavaScript?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!