1

I have a simple form with two hidden inputs that is causing extra white space in Firefox. I've been in trouble with this for few days.

<form name="DemoForm" method="get">
<input type="hidden" name="isposted" value="">
<input type="hidden" value="2" id="SelectedTab" name="SelectedTab"></form>

It is rendered in cell. After that, there is a div with content, but in firefox there is a extra white space above the div. Only in Firefox.

I try to fix this putting the form in a div with display:none, its elements in div with "dispay:none" and other things that I have found in the net, but nothing help...

Has anyone met this issue before?

gotqn
  • 36,464
  • 39
  • 145
  • 218

3 Answers3

8

I have fix this issue using div container with "display:none" but removing the "type:hidden" from each element.

The final code looks as follows:

<div style="display:none">
    <form  name="DemoForm" method="get">
        <input name="isposted" value="">
        <input value="2" id="SelectedTab" name="SelectedTab">
    </form>
</div>

Sure, this could be useful for someone. :- ]

gotqn
  • 36,464
  • 39
  • 145
  • 218
3

Try removing all white spaces and newline characters within the form, like this:

<form name="DemoForm" method="get"><input type="hidden" name="isposted" value=""><input type="hidden" value="2" id="SelectedTab" name="SelectedTab"></form>
Esteve
  • 1,599
  • 17
  • 22
  • Yeah, I have try this. It is rendered by asp file - I mean "Response.Write ... " and I have put all on the same line, but it did not work. – gotqn Aug 09 '12 at 09:58
0

Similar idea to gotqn.

Make data field intended to be hidden an ordinary text field. Just "hide" the input field by making it the same background-color as the form background. If you want to hide the field data, use a text color the same as the background. If you want to display some message/number in it, use a text color that is contrastingly different.

Trunk
  • 530
  • 8
  • 18