make entire form invisible

M

Mr. x

Hello,
How can I make a form (tag = "<form>") invisible ?

<form id = "myform"> ...

myform.style.visibility = "hidden"; // this doesn't work !!!

Thanks :)
 
L

Lasse Reichstein Nielsen

Mr. x said:
How can I make a form (tag = "<form>") invisible ?

<form id = "myform"> ...

myform.style.visibility = "hidden"; // this doesn't work !!

How doesn't it work? How is it called? In which browser?

The try:
document.forms['myform'].style.visibility="hidden";
or
document.getElementById("myform").style.visibility="hidden";

It is very bad style to just assume that the form's name can be used
as a global variable. It breaks in many browsers.

/L
 
S

Stuart Palmer

I'd create a div round the <form> </form> and then hide the contents of the
div.

Stu
 
V

Vjekoslav Begovic

Mr. x said:
Hello,
How can I make a form (tag = "<form>") invisible ?

<form id = "myform"> ...

myform.style.visibility = "hidden"; // this doesn't work !!!

It does work, at least in IE. Problem is somewhere else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top