Re: text input truncated

From: Date: Tue, 04 Nov 2003 23:29:26 +0000
Subject: Re: text input truncated
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168520@lists.php.net to get a copy of this message
On Nov 4, 2003, at 6:27 PM, Jay Frumkin wrote:
Hi all, I am having a bit of a problem, and was wondering if you could help? Here's the sample code (very simple) <?php $xyz = "Hello World"; echo "<form><input type=test size=25 value=$xyz></form>"; ?> The text box shows up with "Hello" NOT "Hello World". How do I get the entire variable?
If you look at the HTML returned, you'll probably see World at the very end of the input tag. To fix this, put quotes around the value attribute. Really, it's good practice to put quotes around all attribute values in HTML: echo "<form><input type=\"test\" size=\"25\" value=\"$xyz\"></form>"; HTH -- Chris Garaffa Nil Zero Heavy Industries http://moondrop.nilzero.com

« previous php.general (#168520) next »