PDA

View Full Version : Form spaces.


flynch01
03-06-2008, 02:20 PM
Is there a way to remove the line breaks that <form></form> create in IE. Firefox is fine as usual.

jerry62704
03-06-2008, 02:35 PM
Do a search here on in line as in the opposite of block. I don't have it readily available or I'd just post it.

flynch01
03-06-2008, 02:56 PM
Brilliant. Only problem is now i'm fixing all my validation errors i'm getting more. I'm right down to two now. Only thing is. This:

<div id="loginbox" style="display: none;">
<form action="index.php" method="post" style="display: inline;">
<input id="userNames" type="text" name="tp" />

</form><br/>
</div>

I get this error. I've had it before, and fixed them all. But this one doesn't seem to be in any other block styled element. And i've double checked that there are no unclosed elements.

Line 32, Column 53: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input id="userNames" type="text" name="tp" />



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

abduraooft
03-06-2008, 03:02 PM
You have to add a block element inside form to wrap your form elements
<form action="index.php" method="post" style="display: inline;">
<div>
<input id="userNames" type="text" name="tp" />
</div>
</form>
But here you may have to again add display:inline; to the div (Assume you are trying to position them inline)

flynch01
03-06-2008, 03:07 PM
Thanks a million :D 0 Validation errors.

Apostropartheid
03-06-2008, 05:01 PM
Although I find fieldset more appropriate.

<form action="index.php" method="post">
<fieldset>
<input type="text"/>
</fieldset>
</form>

VIPStephan
03-06-2008, 05:21 PM
Fieldset is actually meant to group certain fields (like divs are used to group/divide regular sections of pages) like in this example (http://de.selfhtml.org/html/formulare/anzeige/fieldset_legend.htm), and is used best with legend elements (as in the just mentioned example).

Sure, you can still use it if you only have one input in your form but in that case there’s not even a real reason. Anyway, it’s just a matter of preference, I guess.

Dan Schulz
03-06-2008, 10:24 PM
An even better way, Stephen, would be to use this method, which actually allows for proper styling of fieldsets (even if the fieldset isn't actually used) in Internet Explorer while still allowing for the form to be accessible (assuming it was coded properly in the first place). http://www.tyssendesign.com.au/articles/legends-of-style/