News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

hidden fields produce space

Started by Parham, December 27, 2003, 12:55:13 PM

Previous topic - Next topic

Parham


<html>

<head>

<title></title>

<style>
form { display:inline; margin:0 }
</style>

</head>
<body>

<form action="nowhere" method="post">
<input type="hidden" name="forms_1" value="a" />
<input type="hidden" name="forms_2" value="b" />
<input type="hidden" name="forms_3" value="c" />
<input type="hidden" name="forms_4" value="d" />
<input type="hidden" name="forms_5" value="e" />
<input type="hidden" name="forms_6" value="f" />
<input type="hidden" name="forms_7" value="g" />
<input type="submit" value="submit1" />
</form>

<nobr />

<form action="nowhere" method="post">
<input type="hidden" name="forms_1" value="a" />
<input type="hidden" name="forms_2" value="b" />
<input type="hidden" name="forms_3" value="c" />
<input type="hidden" name="forms_4" value="d" />
<input type="hidden" name="forms_5" value="e" />
<input type="hidden" name="forms_6" value="f" />
<input type="hidden" name="forms_7" value="g" />
<input type="submit" value="submit2" />
</form>

<nobr />

<form action="nowhere" method="post">
<input type="hidden" name="forms_1" value="a" />
<input type="hidden" name="forms_2" value="b" />
<input type="hidden" name="forms_3" value="c" />
<input type="hidden" name="forms_4" value="d" />
<input type="hidden" name="forms_5" value="e" />
<input type="hidden" name="forms_6" value="f" />
<input type="hidden" name="forms_7" value="g" />
<input type="submit" value="submit3" />
</form>

</body>
</html>


If you look at that piece of code in a browser, you'll come to realize that the hidden fields produce useless spaces.  The only solution I've read for this is to put them inside tables, but that seems like a very messy solution especially since i'm trying to ignore tables as much now.  I was wondering if anyone knew how to get hidden fields not to produce spaces as their placekeepers when viewing html.

btw, is <nobr /> deprecated?  I don't think I need them because my forms are inline, but I'm just curious.

Cimme

I never worked with hidden fields! :D

But you could manage it with width="1"  :D
then you'll only need maxlength for the maximum entries.

and write it in just one line! :D

greetz
^^ a german metal fan ^^

[Unknown]

If you're really lazy, you can be tricksy and do this:

<input ...
/><input ...
/>

-[Unknown]

Tim

try putting the hidden fields in a div that has vissibility hidden in the css

Advertisement: