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 8 of 8
  1. #1
    New Coder
    Join Date
    May 2010
    Posts
    15
    Thanks
    2
    Thanked 1 Time in 1 Post

    xhtml Strict Form help [PROBLEM SOLVED]

    I'm building/have mostly built a form for my web site and just want it to be xhtml 1.0 strict but I have 2 errors

    FIXED:
    The main one tells me that the attribute form has to be inside object, del, ins or some others, I'm not sure why. I have tried searching for a resolution to no avail I guess I'm not sure what I should be searching for. But it's annoying me so any help on how to contain a form would be appreciated.

    FIXED:
    The next 2 are that I need another method to onFocus so that I can make text disappear when the input field is clicked.

    If you need to see the source it's at http://metagrafik.co.uk/contact/




    Thanks.

    Also while I'm here does anyone know where I can get standalone versions of IE 6 and 7 for windows 7 X64 please?
    Last edited by shepherd; 05-18-2010 at 10:22 PM. Reason: Resolved

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    I don't see anything on the w3 validator about "attribute form has to be inside object" or about "form" at all. When fixing validation problems, start at the top and work down. This is the first: "syntax of attribute value does not conform to declared value". You have an empty ID attribute on your object tag.

    Now, for that object tag itself, why are you using it? Look at your code:
    Code:
                    <object id="">
                        <form method="post" action="">
                            <!-- stuff here -->
                        </form>
                    </object>
    Is there some secret sauce here that requires that object tag?
    Are you a Help Vampire?

  • #3
    New Coder
    Join Date
    May 2010
    Posts
    15
    Thanks
    2
    Thanked 1 Time in 1 Post
    The form is managed with php (client side if that matters, let me know if you need to see the code).
    I just put the empty object tag there to see if it got rid of the problem but if I take it away it says I need it and obviously with it there it has to be defined but I'm not sure how.
    ignoring the object tags, is there another way to contain a php form and keep it strict?

    Thanks.

    edit:
    I've removed the object tags for validation checking.
    Last edited by shepherd; 05-18-2010 at 09:54 PM.

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    PHP can generate the form's HTML and it can handle the data from a submitted form, but it doesn't "manage" forms or do anything on the client side, so I'm not sure what you're talking about there.

    Now, for the first error in the w3 validator:
    "document type does not allow element "form" here..."
    And then it complains (vaguely as it sometimes does) about incorrect containers.

    Here's the section of code:
    Code:
                    <p>
                    
                        <form method="post" action="">
                            <!-- stuff here -->
                        </form>
                    
                    </p>
    Drop those paragraph tags and revalidate.
    Are you a Help Vampire?

  • Users who have thanked tomws for this post:

    shepherd (05-18-2010)

  • #5
    New Coder
    Join Date
    May 2010
    Posts
    15
    Thanks
    2
    Thanked 1 Time in 1 Post
    Haha, Thanks. I can't believe I over looked such a simple error, removing the para tags did it (I'm not even sure why they were in there).

    Also, what I meant by the form is that it all works from that single page, checking and then sending all with php.

    any ideas on an alternative to onFocus?

    Thanks again for the help.

  • #6
    New Coder
    Join Date
    May 2010
    Posts
    69
    Thanks
    3
    Thanked 10 Times in 10 Posts
    attributes have to be lowercase, so "onfocus" and "onblur" will do just fine.

  • Users who have thanked rvincenten for this post:

    shepherd (05-18-2010)

  • #7
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Quote Originally Posted by shepherd View Post
    any ideas on an alternative to onFocus?
    Yes: onfocus

    XHTML requires elements and attributes to be all lowercase.
    Are you a Help Vampire?

  • #8
    New Coder
    Join Date
    May 2010
    Posts
    15
    Thanks
    2
    Thanked 1 Time in 1 Post
    Wow, thanks very much for the help guys problems solved!


  •  

    Tags for this Thread

    Posting Permissions

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