Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value from database to form only displays firstword 1

Status
Not open for further replies.

overflo

Technical User
Feb 10, 2003
70
AU
I have an editable form that when the value is called from database it will only display the first word in the text input field. If I change it to a textarea, or when it is called anywhere else on the site it displays correctly. I haven't come across this problem before. Does anyone know what might be causing it?
 
a couple of possible problems:

1. you are not quoting the value in the text box
Code:
<input type="text" name="text box" value="<?=$row['fieldname']?>" />
without the quotes the value will stop after the first space

2. your db values contain carriage returns. if so strip em out first.

item 1 is far more likely.
 
Thanks.
It was item 1
As the html is generated from PHP I had put
Code:
<input name='name' type='text' id='name' value=$name>
The quotes fixed it. I won't make that mistake again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top