Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to show/hide textfield for each click

 
preethi venkatarangan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Research on javascript .display, as below:

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic