Page 1 of 1

Probleme when I set a value to an input

Posted: Fri Apr 08, 2005 3:51 pm
by schneiderj
Hello !

I have a probleme with the the following code :

Code: Select all

<html><body>
<?php
 	$Nom = "Louis Marie";
?>
<input name="nom" type="text" size="80" value=<?php echo $Nom; ?>>
</body></html>

when I point my browser to this page I have only the truncated name in the input field (only Louis)...

Where is the error ?
Thanks for your help,
Jean-Marie

Posted: Fri Apr 08, 2005 4:38 pm
by shiznatix
i dont see any error, but maybe im blind. your problem is that it only displays Louis in the text field not Louis Marie??

try echoing $Nom out right after you set it and see what happens.

maybe do

Code: Select all

<input name="nom" type="text" size="80" value="<? echo $Nom; ?>">
just a guess.

Posted: Fri Apr 08, 2005 5:45 pm
by Chris Corbyn
Shiz is correct. Having whitespace in an attribute value with no quotes is a no go. The second word reads like it should be an attribute in itself ;-)

Posted: Sat Apr 09, 2005 1:11 am
by schneiderj
Thank you for your reply.

I try your solution and that did not till work :? . I have a look at the code in the browser and I have this :

Code: Select all

<input name=&quote;nom&quote; size=&quote;80&quote; value=&quote;Louis&quote; Marie=&quote;&quote; type=&quote;text&quote;>
Marie is a new parameter of input :evil: . What can I do ?

Posted: Sat Apr 09, 2005 2:59 am
by schneiderj
Sorry that solution work... :oops:
Thank you for your help :D .

Jean-Marie