Re: Submit hitting enter problem
| From: | Jason Wong | Date: | Mon, 11 Nov 2002 10:04:21 +0000 |
| Subject: | Re: Submit hitting enter problem | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123794@lists.php.net to get a copy of this message | ||
On Monday 11 November 2002 17:59, Richard Allsebrook wrote:
> One point nobody seems to have raised about why its important to quote
> attribute values ...
>
> <?
> $Value="foo bar";
> echo "<INPUT type=text value=$Value>";
> ?>
>
> will produce the following code in the browser
>
> <INPUT type=text value=foo bar>
>
> and renders in the browser (testing in ie6) as a text box containing only
> the word foo
>
> (The browser sets the value to foo and things bar is an unknown attribute
> so correctly ignores it)
>
> quoting the attribute value fixes it
>
> <?
> $Value="foo bar";
> echo "<INPUT type='text' value='$Value'>
> ?>
>
> produces
>
> <INPUT type='text' value='foo bar'>
The OP is aware of this and has pointed it out :)
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Start every day off with a smile and get it over with.
-- W.C. Fields
*/