This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Add text when Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Add text when "add" button is clicked" Watch "Add text when "add" button is clicked" New topic
Author

Add text when "add" button is clicked

Ambika Jain
Ranch Hand

Joined: Jan 27, 2005
Posts: 48
Hi,

In my jsp page, there is an option for adding new entries. I have a "add" button. I want to show the text field (in which info will be typed) to be
shown only if I click on "Add". How do I do this ?

Thanks


Ambika Jain
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Moved to HTML/Javascript.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Use CSS to initially hide the text field, and reveal it when the Add button is clicked. Look up the display CSS attribute in order to hide/show elements.
Ambika Jain
Ranch Hand

Joined: Jan 27, 2005
Posts: 48
Can you please show some example. I have not done this before.

Thanks,
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Add text when "add" button is clicked