...

View Full Version : xhtml Strict Form help [PROBLEM SOLVED]



shepherd
05-18-2010, 08:58 PM
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?

tomws
05-18-2010, 09:40 PM
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:

<object id="">
<form method="post" action="">
<!-- stuff here -->
</form>
</object>
Is there some secret sauce here that requires that object tag?

shepherd
05-18-2010, 09:46 PM
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.

tomws
05-18-2010, 10:07 PM
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:

<p>

<form method="post" action="">
<!-- stuff here -->
</form>

</p>

Drop those paragraph tags and revalidate.

shepherd
05-18-2010, 10:13 PM
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.

rvincenten
05-18-2010, 10:17 PM
attributes have to be lowercase, so "onfocus" and "onblur" will do just fine.

tomws
05-18-2010, 10:18 PM
any ideas on an alternative to onFocus?


Yes: onfocus

XHTML requires elements and attributes to be all lowercase.

shepherd
05-18-2010, 10:19 PM
Wow, thanks very much for the help guys problems solved!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum