...

View Full Version : XHTML Validation



MrDoubtFire
01-29-2003, 04:32 PM
I was validating a couple of pages (xhtml 1.1) and it told me that the <input> tag needed to be in another tag, it was illegal as it was (the code is below).


<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="xxxx@hotmail.com" />
<input type="hidden" name="display" value="1" />
</fieldset>
</form>


Now, the validator told me this:

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



I suppose my question is this: would a simple <fieldset> tag around all hidden fields fix this? Would this, considering that it is only hidden fields inside the fieldset, put the box around them (even though they don't show up on the page)? Would an <ins> tag be better to use?

Thanks,

MrDoubtFire

cg9com
01-29-2003, 05:38 PM
ive never even heard of fieldset
did you try just taking away that tag?
maybe just adding your form inside of another element like <p>

<edit message="remember an xhtml document is a XML document, and needs to be built the same way" />

brothercake
01-29-2003, 07:21 PM
<fieldset> is an important part of form semantics (add the <legend> element and you get a little caption :)) .. but it does seem a little pointless to use it around hidden elements;

I tried your example though, and it validates if you take out the "target" attribute; it seems that's deprecated

MrDoubtFire
01-30-2003, 04:12 PM
Thanks for the responses!

I wrote to Paypal and they told me that although it would be fine to remove the 'target="Paypal"' section, it would mess up the shopping cart a little. So I have to live with it until Paypal fixes their code.

Also as per the hidden elements, thankfully each section I have has a graphic/link from Paypal, which the fieldset/legend works fine with. It also does -not- add in extra spaces for each hidden input I have, which I thought it would.

MrDoubtFire



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum