Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Facebook & Javascript - Set textfield to hide by default

Posted on 2010-09-06
5
Medium Priority
?
329 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 83

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:
Gurvinder Pal Singh earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Suggested Courses

877 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