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'>

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:200211111233.17744.php-general@;gremlins.com.hk...
> On Monday 11 November 2002 10:44, rija wrote:
> > What am I missing?
> >
> > My form does not submit when I hit enter in the text box.
> > I do something approximately like this :
> >
> > <form action="index.php?s=add" method=post>
> > ....
> > <input type=text name=bongabe value=something>
> > ...
> > <input type=submit value=submit name=submit>
> >
>
> What happens when ENTER is pressed depends on what browser you're using.
> Different browsers exhibit different behaviours, eg the old versions of
> Netscape (v4 and before) does not submit on ENTER. Also, put quotes around
> your attribute values eg:
>
> <input type="text" name="bongabe" value="something">
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> The more I know men the more I like my horse.
> */
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to