Page 1 of 1

click out the hidden textbox.

Posted: Tue Apr 12, 2005 6:01 am
by valen53
i have a transaction form. B'cos too many textbox in the form, i hope that some of the textbox can be hidden, but will show a link or title for click out the hidden textbox. If dunwant to used, click again to hidden it.

any source can refer ?

thank's reply

Posted: Tue Apr 12, 2005 7:09 am
by zenabi

Posted: Tue Apr 12, 2005 7:22 am
by Chris Corbyn
:?: :?:

You mean... how do you hide a textbox?

You could use some tricky DOM scripting (a bit advanced perhaps).

Or get there abouts the same effect by just chaging the display from none to block.

Code: Select all

<script type=&quote;text/javascript&quote;>
function toggleON() {
	document.getElementById('showHide').style.display = 'block';
	document.getElementById('toggleLink').innerHTML = '<a href=&quote;javascript:toggleOFF()&quote;>Hide text box</a>';
}
function toggleOFF() {
	document.getElementById('showHide').style.display = 'none';
	document.getElementById('toggleLink').innerHTML = '<a href=&quote;javascript:toggleON()&quote;>Show text box</a>';
}
</script>

<span id=&quote;toggleLink&quote;><a href=&quote;javascript:toggleON()&quote;>Show text box</a></span>
<form>
<div id=&quote;showHide&quote; style=&quote;width:400px; height:200px; display:none&quote;>
<textarea style=&quote;width:100%; height:100%&quote;>Text here</textarea>
</div>
HTML Content here
</form>

Posted: Wed Apr 13, 2005 5:25 am
by valen53
thanks for reply.

Its Quite useful.

In win XP2, for setting firewall there got menu i wanted.
Just like i click the title, the menu will close up, click again, menu will opened.

any website or source can i refer do ?

Thank you

Posted: Wed Apr 13, 2005 6:17 am
by n00b Saibot
This is achieved in following way

Code: Select all

<script>
function doIt()
{
if(document.getElementById('menu').display == &quote;none&quote;)
  document.getElementById('menu').display = &quote;&quote;;
else
  document.getElementById('menu').display = &quote;none&quote;;
}
</script>
<p onclick=&quote;doIt()&quote;>Show / Hide Menu</p>
<div id=&quote;menu&quote;>
<ol>
<li>One
<li>Two
<li>Three
<li>Four
<li>Five
</ul>
</div>
Put the above code in HTML file and try it out ;)

PS:d11wtq, these are my favorite ones ... JS ... ;)

Posted: Thu Apr 14, 2005 1:48 am
by valen53
Thank you.