Forum Moderators: coopster

Message Too Old, No Replies

Textboxes not displaying all data

data from mysql db

         

lubber123

7:36 pm on Mar 25, 2009 (gmt 0)

10+ Year Member



I insert data - such as a title of something into a mysql db. When I retrieve the data I place it into a variabel called $value. If I simply echo the value I get all the data, however, if I try to display the data in a textbox only the first word is displayed. Anything after a word break is omitted.

e.g. the db contains "John Doe"
if I retrieve the data and echo, I get "John Doe"

If I use the code below I get "John"

<input name="cd_title" type="text" id="required" class="textbox" size="50" maxlength="150" value = "' . $value . '">';

Does anyone understand what is happening here?

penders

10:07 pm on Mar 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This doesn't make a whole lot of sense to be honest. Is your space/word break some strange character and not actually a space at all? What does the source of the resulting page look like?

eeek

12:32 am on Mar 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What do you see when you look at the html source?

lubber123

3:01 pm on Mar 26, 2009 (gmt 0)

10+ Year Member



So, here is some of the source. One of the text boxes called cd_master_owner should display the test data 'testfname testlname'. When I check in the db it is there and it is in the source code. However only the first word (testfname ) is shown in the textbox.
The other textbox, cd_title, should display 'Test1stword test2ndword' - it is in the DB and source but only shows the 'Test1stword.'


</td><td valign='middle'>&nbsp;<input name="cd_master_owner" id="required" type="text" class="textbox" size="20" maxlength="70" value = testfname testlname>

<input name="cd_title" type="text" id="required" class="textbox" size="50" maxlength="150" value = Test1stword test2ndword>

An156

3:04 pm on Mar 26, 2009 (gmt 0)

10+ Year Member



use
value='<?php echo $testfname; echo $testlname; ?>'

Hope this will help u!

lubber123

3:04 pm on Mar 26, 2009 (gmt 0)

10+ Year Member



Thanks for your help - on re-reviewing the code I see I am missing quotes and hence it is only showing the first word as the value. Thanks for your time.