aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to show/hide textfield  for each click 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/hide textfield  for each click " Watch "how to show/hide textfield  for each click " New topic
Author

how to show/hide textfield for each click

preethi venkatarangan
Greenhorn

Joined: Jan 21, 2007
Posts: 27
Hi i would like to know how to write a javscript function to show a set of textfields base on the hyperlink clicked.Say for example I have 4 textfields each of different sizes.By default there is only 1 textfiled shown & i have hyperlink next to it.now when the user clicks the hyperlink for the first time i have 2 show a textfield with maximum length 10.Now when the user click the same hyperlink the 2nd time i have to show another textfield with say maximum length 5.how do i do this.I know how to show/hide layers but how do i show/hide layer based on each click on the same link.It wud be nice if someone could provide a sample code of the function.

Thanks in Advance.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
Research on javascript .display, as below:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61232
    
  66

Originally posted by preethi venkatarangan:
I know how to show/hide layers but how do i show/hide layer based on each click on the same link.

Seems simple to toggle back and forth. If it's hidden, then show it. If it's displayed, then hide it. You could also just keep a boolean variable around to record odd/even clicks.

It wud be nice if someone could provide a sample code of the function.


Please use real words when posting to the forums. Abbreviations such as "wud" in place of "would" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to show/hide textfield for each click