aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to show a textfield dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to show a textfield dynamically " Watch "How to show a textfield dynamically " New topic
Author

How to show a textfield dynamically

preethi venkatarangan
Greenhorn

Joined: Jan 21, 2007
Posts: 27
Hi everyone..
I want to know how to show or hide a text filed based on the value selected in a Drop down List.
Say for example i have created a DropDownList which has numbers 1,2,3 using the <html:select> tag &<htmlptionsCollection> tag.
Now if i need to display 1 textfield if the user has selected 1 from dropdownlist, 2 textfields if user has selected 2 from the list.

Can someone please help me by providing a sample code.I need it very badly.

Thanks in Advance For your help.


[BSouther: Removed Urgent!!!] from subject line.]
[ January 25, 2008: Message edited by: Ben Souther ]
Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi
You need to write div tags for this purpose.
And with the help of java script you can hide or show these div tags.
Thanks


Khushwinder
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by preethi venkatarangan:
Hi ...I need it very badly.
We all do.

preethi,
Welcome to Javaranch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseAMeaningfulSubjectLine

Please, also look at
EaseUp to find out why adding "Urgent" to your posts or subject line can actually slow down or halt responses to your question altogether.

Again, welcome to JavaRanch and good luck with your question.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

As Khushwinder Chahal has mentioned, the easiest place to do this is on the client with Javascript.

I'm going to move this to our HTML/Javascript forum for you.
preethi venkatarangan
Greenhorn

Joined: Jan 21, 2007
Posts: 27
Originally posted by Khushwinder Chahal:
Hi
You need to write div tags for this purpose.
And with the help of java script you can hide or show these div tags.
Thanks

Hi Can you provide me an example .i know you can hide it with javscript.but it would be nice if you could provide a sample code.so that i could get a clear idea.
Thanks for the quick response...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to show a textfield dynamically