By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

W3C Validator Question/Problem

P: n/a
Hello all,

I'm getting a strange error when I try to validate my page(s). The
error occurs when I use SELECT and INPUT tags inside of the FORM tag.
I am trying to use the XHTML 1.0 Strict standard. I am also using
ColdFusion, but I having been using regular FORM tags instead of the
proprietary CFFORM tags. If you can't put SELECT and INPUT tags inside
of the FORM tag, where are you supposed to put them???

Take a look and tell me what you think:
http://validator.w3.org/check?uri=ht...ically%29&ss=1

Much thanks in advance. -Dave
Jul 20 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
Dave wrote:
I'm getting a strange error when I try to validate my page(s).
It's not really that strange. Have a look at the spec to see.
The error occurs when I use SELECT and INPUT tags inside of the
FORM tag.
....as direct children. In strict, they must be wrapped in a block
level element, e.g.,

<form>
<div>
<input>
</div>
</form>
I am trying to use the XHTML 1.0 Strict standard.
As usual, this raises the question: Why XHTML/strict instead of the
more widely supported HTML/strict?
http://validator.w3.org/check?uri=ht...ically%29&ss=1


--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

P: n/a
Dave wrote:
I'm getting a strange error when I try to validate my page(s). The
error occurs when I use SELECT and INPUT tags inside of the FORM tag.
I am trying to use the XHTML 1.0 Strict standard. I am also using
ColdFusion, but I having been using regular FORM tags instead of the
proprietary CFFORM tags. If you can't put SELECT and INPUT tags inside
of the FORM tag, where are you supposed to put them???

Take a look and tell me what you think:
http://validator.w3.org/check?uri=ht...ically%29&ss=1


It does look counter-intuitive but the validator correctly identifies
that the document does not validate against XHTML 1.0 Strict.

The content model for form elements only has block elements and
miscellaneous elements (script, noscript, ins and del).

<form ...>
<div>
....
</div>
</form>

validates and should work in your case.

--
Klaus Johannes Rusch
Kl********@atmedia.net
http://www.atmedia.net/KlausRusch/
Jul 20 '05 #3

P: n/a
On 11 Jun 2004 07:12:48 -0700, Dave <ba********@hotmail.com> wrote:
Hello all,

I'm getting a strange error when I try to validate my page(s). The
error occurs when I use SELECT and INPUT tags inside of the FORM tag.
I am trying to use the XHTML 1.0 Strict standard. I am also using
ColdFusion, but I having been using regular FORM tags instead of the
proprietary CFFORM tags. If you can't put SELECT and INPUT tags inside
of the FORM tag, where are you supposed to put them???

Take a look and tell me what you think:
http://validator.w3.org/check?uri=ht...ically%29&ss=1

Much thanks in advance. -Dave


Wrap the select and input in div elements and you'll be fixed up. You can
get them to display side by side as in the original code with CSS.
Jul 20 '05 #4

P: n/a


Dave wrote:

I'm getting a strange error when I try to validate my page(s). The
error occurs when I use SELECT and INPUT tags inside of the FORM tag.
I am trying to use the XHTML 1.0 Strict standard. I am also using
ColdFusion, but I having been using regular FORM tags instead of the
proprietary CFFORM tags. If you can't put SELECT and INPUT tags inside
of the FORM tag, where are you supposed to put them???

Take a look and tell me what you think:
http://validator.w3.org/check?uri=ht...ically%29&ss=1


Well if you want to code to a standard than it can't hurt to look at it,
the DTD of XHTML 1.0 strict can be found at
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
if you look at the definition of the form element it is
<!ELEMENT form %form.content;>
and form.content is defined as
<!ENTITY % form.content "(%block; | %misc;)*">
that is block or misc where block is
<!ENTITY % block
"p | %heading; | div | %lists; | %blocktext; | fieldset | table">
and misc
<!ENTITY % misc "noscript | %misc.inline;">
and misc.inline is
<!ENTITY % misc.inline "ins | del | script">
so indeed you don't find any form controls like select or input or
textarea allowed as direct content of a <form> element.
The reason is that XHTML 1.0 strict like HTML 4.01 strict wants you to
structure your document cleanly and put form controls in appropriate
containers like a <fieldset> element or a <p> element.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #5

P: n/a

Brian wrote:
Dave wrote:

I'm getting a strange error when I try to validate my page(s).

It's not really that strange. Have a look at the spec to see.

The error occurs when I use SELECT and INPUT tags inside of the
FORM tag.

...as direct children. In strict, they must be wrapped in a block
level element, e.g.,

<form>
<div>
<input>
</div>
</form>


I was positively suprised how easy it was to get a nice looking field
for a mailto form on my "testing site"
(http://w1.978.telia.com/~u97802964/kontakt.html), using the
<fieldset> tag. Hell of a job to make the same as a table!
BTW I don't have CGI on that server so I used a remote server.
--
/Arne
Jul 20 '05 #6

P: n/a
Arne <ar********@telia.com> wrote in
news:Aq********************@newsc.telia.net:
I was positively suprised how easy it was to get a nice looking field
for a mailto form on my "testing site"
(http://w1.978.telia.com/~u97802964/kontakt.html), using the
<fieldset> tag. Hell of a job to make the same as a table!
BTW I don't have CGI on that server so I used a remote server.


"nice looking" doesn't describe this:
http://members.shaw.ca/caninfosys/temp/kontakt.jpg

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 20 '05 #7

P: n/a
Dave Patton wrote:
Arne <ar********@telia.com> wrote in
news:Aq********************@newsc.telia.net:

I was positively suprised how easy it was to get a nice looking field
for a mailto form on my "testing site"
(http://w1.978.telia.com/~u97802964/kontakt.html), using the
<fieldset> tag. Hell of a job to make the same as a table!
BTW I don't have CGI on that server so I used a remote server.

"nice looking" doesn't describe this:
http://members.shaw.ca/caninfosys/temp/kontakt.jpg


This has nothing whatsoever to do with the mentioned <fieldset> element,
however.
Matthias
Jul 20 '05 #8

P: n/a


Dave Patton wrote:
Arne <ar********@telia.com> wrote in
news:Aq********************@newsc.telia.net:

I was positively suprised how easy it was to get a nice looking field
for a mailto form on my "testing site"
(http://w1.978.telia.com/~u97802964/kontakt.html), using the
<fieldset> tag. Hell of a job to make the same as a table!
BTW I don't have CGI on that server so I used a remote server.

"nice looking" doesn't describe this:
http://members.shaw.ca/caninfosys/temp/kontakt.jpg


Dave, read my post once again. I was pointing out the use of
<fieldset>, and not the page! But, by all means try it again if you like.

--
/Arne
Jul 20 '05 #9

P: n/a


Matthias Gutfeldt wrote:
Dave Patton wrote:
Arne <ar********@telia.com> wrote in
news:Aq********************@newsc.telia.net:
I was positively suprised how easy it was to get a nice looking field
for a mailto form on my "testing site"
(http://w1.978.telia.com/~u97802964/kontakt.html), using the
<fieldset> tag. Hell of a job to make the same as a table!
BTW I don't have CGI on that server so I used a remote server.

"nice looking" doesn't describe this:
http://members.shaw.ca/caninfosys/temp/kontakt.jpg

This has nothing whatsoever to do with the mentioned <fieldset> element,
however.


That's correct. But I guess some have trouble with the reading :-)
BTW: I have trouble to get that form with the fieldset to centering
horizontaly. The style "text-align:center" don't help, <center> do it
but don't validate. Any clue?

--
/Arne
http://w1.978.telia.com/~u97802964/
Jul 20 '05 #10

P: n/a
Arne <ar********@telia.com> wrote in
news:Sf********************@newsc.telia.net:


Dave Patton wrote:
Arne <ar********@telia.com> wrote in
news:Aq********************@newsc.telia.net:

I was positively suprised how easy it was to get a nice looking field
for a mailto form on my "testing site"
(http://w1.978.telia.com/~u97802964/kontakt.html), using the
<fieldset> tag. Hell of a job to make the same as a table!
BTW I don't have CGI on that server so I used a remote server.

"nice looking" doesn't describe this:
http://members.shaw.ca/caninfosys/temp/kontakt.jpg


Dave, read my post once again. I was pointing out the use of
<fieldset>, and not the page! But, by all means try it again if you like.


I wasn't suggesting that there was anything wrong with the use
of the <fieldset>, but took the screen capture in case you
didn't know the page didn't "look nice" :-)

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 20 '05 #11

P: n/a


Dave Patton wrote:
Arne <ar********@telia.com> wrote in
news:Sf********************@newsc.telia.net:


Dave Patton wrote:

Arne <ar********@telia.com> wrote in
news:Aq********************@newsc.telia.net:

I was positively suprised how easy it was to get a nice looking field
for a mailto form on my "testing site"
(http://w1.978.telia.com/~u97802964/kontakt.html), using the
<fieldset> tag. Hell of a job to make the same as a table!
BTW I don't have CGI on that server so I used a remote server.
"nice looking" doesn't describe this:
http://members.shaw.ca/caninfosys/temp/kontakt.jpg


Dave, read my post once again. I was pointing out the use of
<fieldset>, and not the page! But, by all means try it again if you like.

I wasn't suggesting that there was anything wrong with the use
of the <fieldset>, but took the screen capture in case you
didn't know the page didn't "look nice" :-)


I understand, but as the link goes only to a "testing page", my first
concern is to make something I test work properly and also validate
(in this case the form with using fieldset). When it does, I try to
fit it in to a page that hopefully can "look nice" with it :)

--
/Arne
http://w1.978.telia.com/~u97802964/
Jul 20 '05 #12

P: n/a
Thanks to all... I feel a bit sheepish for not spotting the problem
when looking at the XHTML 1.0 spec. Too many hours of staring at this
screen I guess. -Dave
ba********@hotmail.com (Dave) wrote in message news:<5e**************************@posting.google. com>...
Hello all,

I'm getting a strange error when I try to validate my page(s). The
error occurs when I use SELECT and INPUT tags inside of the FORM tag.
I am trying to use the XHTML 1.0 Strict standard. I am also using
ColdFusion, but I having been using regular FORM tags instead of the
proprietary CFFORM tags. If you can't put SELECT and INPUT tags inside
of the FORM tag, where are you supposed to put them???

Take a look and tell me what you think:
http://validator.w3.org/check?uri=ht...ically%29&ss=1

Much thanks in advance. -Dave

Jul 20 '05 #13

P: n/a
Arne wrote:
BTW: I have trouble to get that form with the fieldset to centering
horizontaly. The style "text-align:center" don't help, <center> do it
but don't validate. Any clue?


http://dorward.me.uk/www/centre/#block
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #14

P: n/a
Arne wrote:
> I was positively suprised how easy it was to get a nice
> looking field for a mailto form on my "testing site"
> (http://w1.978.telia.com/~u97802964/kontakt.html), using
> the <fieldset> tag.
my first concern is to make something I test work properly and also
validate (in this case the form with using fieldset).


Validation is all well and good, but perhaps you'd consider what
<fieldset> is for. It isn't to provide borders to make the form look nice.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #15

P: n/a

David Dorward wrote:
Arne wrote:

BTW: I have trouble to get that form with the fieldset to centering
horizontaly. The style "text-align:center" don't help, <center> do it
but don't validate. Any clue?

http://dorward.me.uk/www/centre/#block


Thank's! Now I get it :-)

Only one small "problem" left. The fieldset with the submit button
don't get as wide as the others, even if I set the wide to 100%.

--
/Arne
Jul 20 '05 #16

P: n/a

Brian wrote:
Arne wrote:

>>I was positively suprised how easy it was to get a nice
>>looking field for a mailto form on my "testing site"
>>(http://w1.978.telia.com/~u97802964/kontakt.html), using
>>the <fieldset> tag.


my first concern is to make something I test work properly and also
validate (in this case the form with using fieldset).

Validation is all well and good, but perhaps you'd consider what
<fieldset> is for. It isn't to provide borders to make the form look nice.


Yes, I understand that to. The "nice" was a "bonus" that give me the
suprise, but not the reason I wanted to try it. :-)

--
/Arne
Jul 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.