Validation errors. How to rid?

M

Mike Barnard

Hi all.

Wonderful weather here. Right, now the niceties are over can anyone
explain why the lines of code provided by 'atomz.com' for their search
bar don't validate when insertes in to my site? Usual URL...

www.thermachek.com/temp/

I registered with atomz and downloaded the code they supplied for the
search bar. (I have NOT studied forms much yet, btw). It failed to
validate. I emailed them and asked for valid code. They sent me
this...


Hi Michael,

You might want to try this.

<div id="search">
<!-- Atomz HTML for Search -->
<form method="get" action="http://search.atomz.com/search/">
<input type="hidden" name="sp_a" value="sp1003d534">
<input size="27" name="sp_q" value="web site" /><br />
<input type="submit" value="Search" />
<input type="hidden" name="sp_p" value="all" />
<input type="hidden" name="sp_f" value="UTF-8" />
</div> <!-- End div search -->

Best Regards,

Shirley
Omniture, Inc.
SiteSearch & Publish Support



It is obviously XHTML, but removing the end tags to bring it to HTML
made no difference. I can't remember if the current online site has
the XHTML ends or not. Oh look, there goes another grey cell.

The errors say...



Validation Output: 9 Errors

1. Error Line 39, Column 52: document type does not allow element
"INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6",
"PRE", "DIV", "ADDRESS" start-tag.

<input type="hidden" name="sp_a" value="sp1003d534">



....etc.

Which seems to say the inline elements aren't enclosed in a block
element, I think? But they're enclosed in a div, which is a block,
right?

Can anyone explain to this dimwit (Points to self) whats wrong? It
works, it just doesn't validate.

Thanks.

Mike.
 
B

Beauregard T. Shagnasty

Mike said:
..the lines of code provided by 'atomz.com' for their search
bar don't validate when insertes in to my site? Usual URL...

www.thermachek.com/temp/

I registered with atomz and downloaded the code they supplied for the
search bar. (I have NOT studied forms much yet, btw). It failed to
validate. I emailed them and asked for valid code. They sent me
this...

Hi Michael,

You might want to try this.

<div id="search">
<!-- Atomz HTML for Search -->
<form method="get" action="http://search.atomz.com/search/">
<input type="hidden" name="sp_a" value="sp1003d534">
<input size="27" name="sp_q" value="web site" /><br />
<input type="submit" value="Search" />
<input type="hidden" name="sp_p" value="all" />
<input type="hidden" name="sp_f" value="UTF-8" />

Add the missing closing said:
</div> <!-- End div search -->

Place another <div> .. </div> around the input elements, *inside* the
form.

Revalidate. (after removing the trailing xhtml slashes of course)
Which seems to say the inline elements aren't enclosed in a block
element, I think? But they're enclosed in a div, which is a block,
right?

'Cept that div is outside the form.
 
E

Els

Mike said:
explain why the lines of code provided by 'atomz.com' for their search
bar don't validate when insertes in to my site?
<form method="get" action="http://search.atomz.com/search/">
<input type="hidden" name="sp_a" value="sp1003d534">
Validation Output: 9 Errors

1. Error Line 39, Column 52: document type does not allow element
"INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6",
"PRE", "DIV", "ADDRESS" start-tag.

<input type="hidden" name="sp_a" value="sp1003d534">

This is because <input> can't go directly inside <form>.
You need any of the above suggestions in between. Or one that isn't
mentioned: <fieldset>.
Assuming you choose a <div>:
<form....>
<div>
<input....>
</div>
...etc.

Which seems to say the inline elements aren't enclosed in a block
element, I think? But they're enclosed in a div, which is a block,
right?

The div needs to be around the <input> elements, but inside the
<form>.

And if they really sent exactly that code - they have no clue. Where
is the </form>?
 
D

dorayme

Mike Barnard said:
Hi all.

Wonderful weather here. Right, now the niceties are over can anyone
explain why the lines of code provided by 'atomz.com' for their search
bar don't validate when insertes in to my site? Usual URL...

www.thermachek.com/temp/

I registered with atomz and downloaded the code they supplied for the
search bar. (I have NOT studied forms much yet, btw). It failed to
validate. I emailed them and asked for valid code. They sent me
this...

Try this instead to get it kosher:

<div id="search">
<!-- Atomz HTML for Search -->
<form method="get" action="http://search.atomz.com/search/">
<div><input type="hidden" name="sp_a" value="sp1003d534">
<input size="27" name="sp_q" value="web site"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp_p" value="all">
<input type="hidden" name="sp_f" value="UTF-8">
</div>
</form>
</div> <!-- End div search -->

(In the URL provided - please put in an http:// in front as not
all newsreaders can click on yours and get it - there are many
wrong closing tags still left in as well as a few other things
that I guess is ot for this query)
 
B

Blinky the Shark

Mike said:
Hi all.

Wonderful weather here. Right, now the niceties are over can anyone
explain why the lines of code provided by 'atomz.com' for their search
bar don't validate when insertes in to my site? Usual URL...

www.thermachek.com/temp/

I registered with atomz and downloaded the code they supplied for the
search bar. (I have NOT studied forms much yet, btw). It failed to
validate. I emailed them and asked for valid code. They sent me
this...


Hi Michael,

You might want to try this.

<div id="search">
<!-- Atomz HTML for Search -->
<form method="get" action="http://search.atomz.com/search/">
<input type="hidden" name="sp_a" value="sp1003d534">
<input size="27" name="sp_q" value="web site" /><br />
<input type="submit" value="Search" />
<input type="hidden" name="sp_p" value="all" />
<input type="hidden" name="sp_f" value="UTF-8" />
</div> <!-- End div search -->

Best Regards,

Shirley
Omniture, Inc.
SiteSearch & Publish Support



It is obviously XHTML, but removing the end tags to bring it to HTML
made no difference. I can't remember if the current online site has
the XHTML ends or not. Oh look, there goes another grey cell.

The errors say...



Validation Output: 9 Errors

1. Error Line 39, Column 52: document type does not allow element
"INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6",
"PRE", "DIV", "ADDRESS" start-tag.

<input type="hidden" name="sp_a" value="sp1003d534">



...etc.

Which seems to say the inline elements aren't enclosed in a block
element, I think? But they're enclosed in a div, which is a block,
right?

Can anyone explain to this dimwit (Points to self) whats wrong? It
works, it just doesn't validate.

The only form I've used is a canned one, but I notice that it has a block
element inside the form, containing everything else. What happens if you
do

<form>
<div>
foo
</div>
</form>

?

And should your form be closed?

I'm just noodling until the form meisters get here. :)
 
B

Blinky the Shark

Blinky said:
The only form I've used is a canned one, but I notice that it has a block
element inside the form, containing everything else. What happens if you
do

<form>
<div>
foo
</div>
</form>

?

And should your form be closed?

I'm just noodling until the form meisters get here. :)

By the time I wrote the above, they'd already given you the (same)
answers. Never mind. :)
 
M

Mike Barnard

Place another <div> .. </div> around the input elements, *inside* the
form.

Revalidate. (after removing the trailing xhtml slashes of course)


'Cept that div is outside the form.

Thank you for the help. I knew it was obvious, it usually is with me.
Off I go again...
 
M

Mike Barnard

This is because <input> can't go directly inside <form>.
You need any of the above suggestions in between. Or one that isn't
mentioned: <fieldset>.
Assuming you choose a <div>:
<form....>
<div>
<input....>
</div>


The div needs to be around the <input> elements, but inside the
<form>.

And if they really sent exactly that code - they have no clue. Where
is the </form>?

Hi.

Yes, that was a cut'n paste from the email. I'm sure the original that
I got from their website had a /form.

I'm learning. Thanks.
 
M

Mike Barnard

Try this instead to get it kosher:

<div id="search">
<!-- Atomz HTML for Search -->
<form method="get" action="http://search.atomz.com/search/">
<div><input type="hidden" name="sp_a" value="sp1003d534">
<input size="27" name="sp_q" value="web site"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp_p" value="all">
<input type="hidden" name="sp_f" value="UTF-8">
</div>
</form>
</div> <!-- End div search -->
Thanks.

(In the URL provided - please put in an http:// in front as not
all newsreaders can click on yours and get it.

OK, Thanks Doe, I didn't know that either.

- there are many
wrong closing tags still left in as well as a few other things
that I guess is ot for this query)

True, but I still want to know what might be wrong. I'm off for a few
days on a course (Fire Assessment, not HTML) from monday so there will
be a lack of cluelessness hereabouts. Enjoy!
 
M

Mike Barnard

The only form I've used is a canned one, but I notice that it has a block
element inside the form, containing everything else. What happens if you
do

<form>
<div>
foo
</div>
</form>

?

And should your form be closed?

You got it right on the nose.
I'm just noodling until the form meisters get here. :)

They've been and gone. You've got to be quicker than that! :)

Thanks.
 
M

Mike Barnard

On Sat, 01 Mar 2008 21:06:09 +0000, Mike Barnard


HOORAY, IT PASSES!

Excuse me shouting. But I still have one warning. I have a <br> at
line 87 and it says

"Line 87, Column 4: unclosed start-tag requires SHORTTAG YES.

<br>After the fire
"

Is there such a thing as a </br> then? Hmmm I'm off to see my mate
Google.

Mike.
 
J

John Hosking

Mike said:
On Sat, 01 Mar 2008 21:06:09 +0000, Mike Barnard


HOORAY, IT PASSES!

Congrats! Now, was that so hard? ;-)
Excuse me shouting. But I still have one warning. I have a <br> at
line 87 and it says

"Line 87, Column 4: unclosed start-tag requires SHORTTAG YES.

<br>After the fire
"

Try checking the "Show source" box and revalidating. Then you can click
on an message's line number and go right to the point in the source.

It appears you have an unfinished <img tag.
 
B

Beauregard T. Shagnasty

Mike said:
Mike Barnard wrote:

HOORAY, IT PASSES!

Excuse me shouting. But I still have one warning. I have a <br> at
line 87 and it says

"Line 87, Column 4: unclosed start-tag requires SHORTTAG YES.

<br>After the fire

That is because the preceding line:

<img src="images/burn1.jpg" width="150" height="100" alt="Aftermath of
fire"

is missing the closing ">"
Is there such a thing as a </br> then?
No.

Hmmm I'm off to see my mate Google.

How was she?
 
B

Blinky the Shark

Mike said:
You got it right on the nose.


They've been and gone. You've got to be quicker than that! :)

<weak little voice>

I've been sick.

</weak little voice

:)

Glad you got it sorted out.
 
M

Mike Barnard

Congrats! Now, was that so hard? ;-)


Try checking the "Show source" box and revalidating. Then you can click
on an message's line number and go right to the point in the source.

It appears you have an unfinished <img tag.

Sometimes I can stare and stare without it sinking in. Thanks.
 
M

Mike Barnard

That is because the preceding line:

<img src="images/burn1.jpg" width="150" height="100" alt="Aftermath of
fire"

is missing the closing ">"
<Homer>

DOH!



How was she?

Quick.
 
B

Beauregard T. Shagnasty

Mike said:
<Homer>

DOH!

</H>

Not always, but frequently, the error the validator reports is related
to something wrong on the preceding line, or element.

When viewing the page's source in Firefox's color-coded source window,
that <img> element was rendered in bright red. A good klew.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top