On Wed, 2002-02-13 at 13:56, Steven Walker wrote: > Hi, > > I'm having trouble setting the value of form elements using variable > values. For example: > > <?$name = "Steven Walker"?> > <form name="form1" method="post" action="infocollect.php"> > <input type="text" name="name" value=<?echo "$name";?>> > </form> > > In the browser, the name field is only filled with "Steven", and drops > off everything after the space. If I echo $name outside of the form it > prints fine. > > Any help would be really appreciated. Thanks!
Always quote your HTML attributes. Your code should read: <? $name = "Steven Walker"; ?> <form name="form1" method="post" action="infocollect.php"> <input type="text" name="name" value="<?echo $name;?>"> </form> Cheers, Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php