Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2002
    Location
    Florida
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XHTML Validation

    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

  • #2
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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" />
    Last edited by cg9com; 01-29-2003 at 08:19 PM.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <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
    Last edited by brothercake; 01-29-2003 at 09:02 PM.

  • #4
    New Coder
    Join Date
    Dec 2002
    Location
    Florida
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •