Closed
Bug 65964
Opened 24 years ago
Closed 24 years ago
Setting style display none does not submit form
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: asreddy_74, Assigned: rods)
Details
Hi,
When the style property of div element containing a form is set to display none,
the form is not submitted. In case any input fields in the form have style
property set to display none then the fields are not submitted.
The example below shows the problem :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Document Title</title>
</head>
<body>
<div style="display:none">
<form id="myForm" method="post" action="test.htm"></form>
</div>
<input type="button" onclick="test()" value="submit">
<script type="text/javascript">
function test()
{
var form = document.getElementById( "myForm" );
form.submit();
}
</script>
</body>
</html>
test.htm file :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="test">
<IFRAME src="http://www.netscape.com" id="test"></IFRAME>
</div>
<input type="button" value="hide" onclick="hide()">
<input type="button" value="show" onclick="show()">
<script>
function hide()
{
document.getElementById("test").style.display = "none";
}
function show()
{
document.getElementById("test").style.display = "";
}
</script>
</body>
</html>
P.S. : Ensure both files located in the same directory
Regards
Srinivas
I'm confused here. display:none is display none, right? By setting that block to
display:none are you saying it still should display that form?
So what about NOT displaying that form output if a block is set to display:none??
Comment 2•24 years ago
|
||
*** This bug has been marked as a duplicate of 34297 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Bug 34297 is about hidden form controls and not the form itself. Also form input
controls should be inside the form, right?
Updated•6 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•