Solved

Facebook & Javascript - Set textfield to hide by default

Posted on 2010-09-06
5
325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 33613069
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
ID: 33613074
just set it to hidden initially
<input type=''text' style='display:none'>
0
 

Author Comment

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

Expert Comment

by:rockiroads
ID: 33613104
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
ID: 33613110
That seemed too easy lol

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

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Link Anchor Not working 9 67
Keyup listener getting fired on initial page load 1 53
Make New Browser Window Fully Functional 7 36
PDF Turn Look 7 38
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

710 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