14 replies [Last post]
enigm4_
Offline
Regular
Western Australia
Last seen: 14 years 42 weeks ago
Western Australia
Joined: 2004-10-14
Posts: 24
Points: 0

I have a text area in a contact form for people to fill in with whatever they want to tell me (http://www.teknetia.com.au/contact.htm). Currently it is displaying as a single line in FF that scrolls horizotally.

Any idea why it wouldnt be displaying properly? The only CSS I have applied to it is the text-color.

Cheers
~Chris

ragamuffin
ragamuffin's picture
Offline
Leader
Iowa
Last seen: 13 years 37 weeks ago
Iowa
Joined: 2005-06-02
Posts: 691
Points: 0

TextArea in FF

Hi Chris,

Textarea is not allowed in XHTML Strict. If you change your XHTML to Transitional, it will probably work. Smile

I found the answer on this site:
http://liorean.web-graphics.com/xhtml/comparison.loose-strict.html

One other thing, it would be a good idea to remove this from top of your code.

<?xml version="1.0" encoding="UTF-8"?>

- r

enigm4_
Offline
Regular
Western Australia
Last seen: 14 years 42 weeks ago
Western Australia
Joined: 2004-10-14
Posts: 24
Points: 0

TextArea in FF

ragamuffin wrote:
Textarea is not allowed in XHTML Strict. If you change your XHTML to Transitional, it will probably work. Smile

It seems to validate ok with the text area, and i dont want to change to transitional so I think i'll find another element if i have to.

ragamuffin wrote:
One other thing, it would be a good idea to remove this from top of your code.

<?xml version="1.0" encoding="UTF-8"?>

- r

I had to add that to the top of the page as it was not validateable and had no encoding.

ragamuffin
ragamuffin's picture
Offline
Leader
Iowa
Last seen: 13 years 37 weeks ago
Iowa
Joined: 2005-06-02
Posts: 691
Points: 0

TextArea in FF

Quote:

ragamuffin wrote:

One other thing, it would be a good idea to remove this from top of your code.

Code:
<?xml version="1.0" encoding="UTF-8"?>

- r

I had to add that to the top of the page as it was not validateable and had no encoding.

Your page is not viewing correctly in IE and that tag could be a cause of it because it is putting IE in quirksmode.

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 9 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

TextArea in FF

textarea is fine in xhtml strict.

I think its probably some wierd interaction between your table cell/row and the textarea element. You haven't specified height on either so FF fits things as it sees fit.

Textareas certainly work fine for me. Put something like this in your CSStextarea {height: 100px;}

You could also do yourself a favour and get rid of the table for your form. Its not necessary. It leads to bad habits in construction of your form, e.g. none of your text inputs have labels.

Try something like

CSS -
input {float:right; }
label {display: block; clear: right;}

HTML -
<label><input type="text" />prompt</label>

You should also make use of fieldset to group similar controls like your radio buttons.

Anonymous
Anonymous's picture
Guru

TextArea in FF

ragamuffin wrote:
Textarea is not allowed in XHTML Strict.
Who says? :?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 38 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

TextArea in FF

Triumph wrote:
ragamuffin wrote:
Textarea is not allowed in XHTML Strict.
Who says? :?

The W3 xhtml 1.0 DTD sz, that's who sz;
<!ELEMENT textarea (#PCDATA)>     <!-- multi-line text field -->
<!ATTLIST textarea
  %attrs;
  %focus;
  name        CDATA          #IMPLIED
  rows        %Number;       #REQUIRED
  cols        %Number;       #REQUIRED
  disabled    (disabled)     #IMPLIED
  readonly    (readonly)     #IMPLIED
  onselect    %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED
  >
Oh, wait. That sz it is allowed. Smile

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

ragamuffin
ragamuffin's picture
Offline
Leader
Iowa
Last seen: 13 years 37 weeks ago
Iowa
Joined: 2005-06-02
Posts: 691
Points: 0

TextArea in FF

Triumph wrote:
Who says?

From the site that I linked earlier...this is what it says...

Quote:
form
Elements a, br, span, bdo, object, applet, img, map, iframe, sub, sup, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, big, small, font, basefont, tt, i, b, u, s, strike, input, select, textarea, label, button not allowed in Strict

Attributes name, target removed in Strict

...looks like it contradicts w3.org :oops:

- r

enigm4_
Offline
Regular
Western Australia
Last seen: 14 years 42 weeks ago
Western Australia
Joined: 2004-10-14
Posts: 24
Points: 0

TextArea in FF

Chris..S wrote:

You could also do yourself a favour and get rid of the table for your form. Its not necessary. It leads to bad habits in construction of your form, e.g. none of your text inputs have labels.

Try something like

CSS -
input {float:right; }
label {display: block; clear: right;}

HTML -
<label><input type="text" />prompt</label>

I use tables only because I've had pretty bad luck with getting labels to work, but I really should go back to it and work it out as I hate tables as a layout function!

I used to use fieldset's all the time for radio buttons, dunno what happened to that.

Setting the height and width have not affected it in firefox at all.

Also, how can I remove the <?xml tag without breaking validation?

Anonymous
Anonymous's picture
Guru

TextArea in FF

ragamuffin wrote:
Triumph wrote:
Who says?

From the site that I linked earlier...this is what it says...Looks like we have a site to add to our "not to be trusted" list. Smile

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 6 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

TextArea in FF

It says not allowed in Strict after every line on that page. Some of the elements are coloured green and some red. The author is probably right in what he/she is trying to say, it's just that they're having a hard time getting the exact intent of their message across.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Anonymous
Anonymous's picture
Guru

TextArea in FF

Tyssen wrote:
It says not allowed in Strict after every line on that page. Some of the elements are coloured green and some red. The author is probably right in what he/she is trying to say, it's just that they're having a hard time getting the exact intent of their message across.
Yes, you seem to be correct. Smile

I wonder what the "not allowed in Strict" part is all about. Perhaps english is not his/her native language.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 38 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

TextArea in FF

the cypher machine wrote:
I use tables only because I've had pretty bad luck with getting labels to work, but I really should go back to it and work it out as I hate tables as a layout function!

I used to use fieldset's all the time for radio buttons, dunno what happened to that.

Setting the height and width have not affected it in firefox at all.

Also, how can I remove the <?xml tag without breaking validation?
Getting forms to look right without tables is the bane of everyone as they move to css layout. It's mostly because you end up stacking rules while writing such clean html markup that the connection is hard to see. An example of css form layout may be seen at form demo.

I agree with Chris that the tables are somehow involved. I haven't done a table layout since early 2003, so no longer grok in fullness its gotchas, and am too lazy to mess with them any more. Tongue [1]

The xml prolog/declaration is not a part of html. As long as you serve the document, even xhtml docs, as text/html, the declaration should not be there.

If the xhtml document is served as an xml MIMEType such as application/xhtml+xml, the declaration is optional as long as you are using xml 1.0 and utf-8 or utf-16, as those are default values for correctly served xhtml.

IOW, if it's not there, it still will validate as xhtml. And, if it is there, it makes IE even more stupid.

cheers,

gary

[1] Most of my work is in fixing pages for design houses. When they bring me a table based layout, I explain that I can refactor the page to best practice html+css at my usual hourly rate or I can fix the table mess charging double the usual hourly rate and probably billing at least double or treble the hours. Did I mention I haven't done a table layout in three years? Wink

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 9 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

TextArea in FF

The textarea not allowed in that link is not saying its not allowed, but that its not allowed here, its talking about which elements can be direct children of other elements.

So a form can't contain as children, input, textarea, button. But a fieldset can contain those three elements, as can, p, div, td, etc.

Similarly an inline element can't be placed directly in the body. The first generation children of a body must be block elements (or tables).

But the overall message is correct. Use those sorts of pages with a pinch of salt. The one reliable source is w3c, if something appears to contradict w3c, either the page you are reading is incorrect or its not clear enough.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

TextArea in FF

This is precisely the reason a certain well known coding forum does not allow external links and removes them if found in posts unless they are of proven and well known provenance.

It prevents unnecessary confusion.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me