Solved

Facebook & Javascript - Set textfield to hide by default

Posted on 2010-09-06
5
314 Views
Last Modified: 2012-05-10
Hello all,

I can use the following code to hide a textfield as follows:

    document.getElementById('answerSequence').setStyle('display', 'none');

I can then show it again using the code below:

    document.getElementById('answerSequence').setStyle('display', '');


However, I want the textfield to be hidden when the page loads initially.  Any ideas how this may be done?

Many thanks, in advance, Colin.
0
Comment
Question by:Canders_12
5 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
Check this thread : http://forum./viewtopic.php?id=5117
onloadRegister(function() {document.getElementById('answerSequence').setStyle('display', 'none');});

Open in new window

0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
Comment Utility
just set it to hidden initially
<input type=''text' style='display:none'>
0
 

Author Comment

by:Canders_12
Comment Utility
sorry, but that thread does not seem in full? am i missing something? :(
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
do what gurvinder says (best) or create a javascript function which hides it and use <body onLoad to call it (not so great lol)
0
 

Author Closing Comment

by:Canders_12
Comment Utility
That seemed too easy lol

I need to get myself on some course!!!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now