Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show / Hide Form Fields using Hyperlink

Status
Not open for further replies.

lakeside12

Programmer
Apr 20, 2009
43
0
0
CA
Hello,
I was searching for some code to show/hide form fields and I found this on your forum


This is almost perfect, except that it uses a check box, I need to use a hyperlink, please can someone show me how to do this, can I convert this code you have to do exactly the same thing except with a Hyperlink?


I hope someone can help
Many thanks
 
Hi Thanks for your reply,

I really am not that skilled to know how to do this, can you possibly show me what you mean

Many thanks
 
Its slightly more complex but here try this:

Code:
function showhidefield(){
  if(document.getElementById("hideablearea").style.display == "block"){
document.getElementById("hideablearea").style.display = "none";
}
  else{
document.getElementById("hideablearea").style.display = "block";
}
}


<div id="hideablearea" style="display:block">
<input type=text ...>
</div>
<a href="#" onClick="showhidefield(); return false;">Click here to show or hide the area</a>




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi

YOU are AMAZING

THANKS A MILLION WORKED FIRSTTIME

PERFECT PERFECT PERFECT PERFECT

BEST REGARDS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top