You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Marc Saegesser <ma...@apropos.com> on 2001/01/13 03:12:45 UTC

[OFF TOPIC] HTML question

Please excuse this way off topic question but I'm looking for someone
smarter than I am and this seems like a good place to look :-)

I'm fighting with an HTML question.  I need to create a hidden <input> tag
whose value will contain white space, double quotes and single quotes.

For example

<input type="hidden" name="fubar" value="lots of crap " ' ">

Obviously that won't work but I'm at a loss for something that will.  The
contents of the value attribute are CDATA and according to the HTML 4.01
specification section 6.2
(http://www.w3.org/TR/1999/REC-html401-19991224/types.html#h-6.2), character
entities in CDATA are supposed to be replaced with characters.  So one might
think that

<input type="hidden" name="fubar" value="lots of crap &quot; &apos; ">

would work but it doesn't in either Netscape or IE.  There must be something
simple that I'm missing.




RE: [OFF TOPIC] HTML question

Posted by Marc Saegesser <ma...@apropos.com>.
Unfortunately, this means the string gets encoded twice which is just
wasteful considering all that's really needed is to escape the quote
character.

Also, the value may contain multibyte characters (Shift_JIS, for example)
and the JavaScript escape() function uses an encoding that is incompatible
with URL encodinig for multibyte characters so you end up having to write
the encoder from scratch is which seems wastefull again since I all that's
really needed to escape the damn quote character.

Anyone know of a good HTML mailing list?

> -----Original Message-----
> From: Jon Stevens [mailto:jon@latchkey.com]
> Sent: Friday, January 12, 2001 8:21 PM
> To: tomcat-dev@jakarta.apache.org
> Subject: Re: [OFF TOPIC] HTML question
>
>
> on 1/12/01 6:12 PM, "Marc Saegesser" <ma...@apropos.com> wrote:
>
> > There must be something simple that I'm missing.
>
> URL encode it.
>
> -jon
>
> --
> Honk if you love peace and quiet.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org


Re: [OFF TOPIC] HTML question

Posted by Jon Stevens <jo...@latchkey.com>.
on 1/12/01 6:12 PM, "Marc Saegesser" <ma...@apropos.com> wrote:

> There must be something simple that I'm missing.

URL encode it.

-jon

-- 
Honk if you love peace and quiet.