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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

please helphide text boxes

Status
Not open for further replies.

angela4eva

Programmer
Apr 29, 2005
46
US
hi,
here is what i am trying to do that .I want to hide the text boxes and diaplay only when the page has finished loading(loading everything even java applet,My understanding is onload is called after everything is done).
below is my code so far..
any help appreciated

window.onload=getboxes;

getboxes()
{


}

< form ...>


<input type="test"name ="username>

<input type="test"name ="username>
</form>
 
The following approach works for me...

<script type="text/javascript" language="JavaScript">
getboxes()
{
.
.
}
</script>
</head>

<body onLoad='startSet()'>

< form ...>


<input type="test"name ="username>

<input type="test"name ="username>
</form>
 
Just set the style property visibility to hidden on each field you want hidden.
When getboxes fires you alter the visibility property for each one to visible.

Code:
window.onload=getboxes; 

getboxes() 
{ 
  document.getElementById('username1').style.visibility=visible;
  document.getElementById('username2').style.visibility=visible;
} 

< form ...> 


<input type="te[COLOR=red]x[/color]t" name="username[COLOR=red]1[/color]" [COLOR=red]id="username1" style="visibility:hidden"[/color]> 

<input type="te[COLOR=red]x[/color]t" name="username[COLOR=red]2[/color]" [COLOR=red]id="username2" style="visibility:hidden"[/color]> 
</form>

It's hard to think outside the box when I'm trapped in a cubicle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top