BeanoEFC Posted January 17, 2010 Share Posted January 17, 2010 hey Everyone, Im am displaying variables in textboxs. The problem i have is if they are more than one word long i get an unexpected result. For Example: $var = "hello"; This will display as expected. $var = "hello world"; This would only display "hello" The code i am using in my text box is as follows <input name="name" type="text" onchange="funcName(this, 'inf_pdt', true);" value=<?php echo $var; ?> /> Please can someone help me out? Thanks, -Beano Link to comment https://forums.phpfreaks.com/topic/188825-displaying-value-in-textbox-unexpected-results/ Share on other sites More sharing options...
emehrkay Posted January 17, 2010 Share Posted January 17, 2010 you need qoutes around html attributes value="<?php echo $val; ?>" Link to comment https://forums.phpfreaks.com/topic/188825-displaying-value-in-textbox-unexpected-results/#findComment-996874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.