Avatar of Canders_12
Canders_12
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Facebook & Javascript - Set textfield to hide by default

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.
JavaScript

Avatar of undefined
Last Comment
Canders_12

8/22/2022 - Mon
leakim971

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

Open in new window

ASKER CERTIFIED SOLUTION
Gurvinder Pal Singh

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Canders_12

ASKER
sorry, but that thread does not seem in full? am i missing something? :(
rockiroads

do what gurvinder says (best) or create a javascript function which hides it and use <body onLoad to call it (not so great lol)
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Canders_12

ASKER
That seemed too easy lol

I need to get myself on some course!!!