Form editing problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Form editing problem

Post by dude81 »

Hello All,

I'm using echoing a form for editing. As soon as I retrieve the values from database, I'm assigning the database values to form values. Now the problem is the database values which are seperated with spaces are not being displayed properly. The first half of the value is being displayed.

For eg:
New south wales is being diplayed just as New.

What function should I use inorder display the complete value


Thank You
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

sounds to me like you aren't quoting your html attributes... post the code.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yep, that definitely sounds like you aren't putting quotes around the attribute values.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

Code: Select all

echo  "<input type=hidden name=id[0] value='$ID'>".
           "<table align=left width='90%' cellspacing='0' cellpadding='0' border='1'><tr><td><b>Edit</b></td></tr>\r\n". 
"<tr><td><h3>Name</h3></td> <td><input type=hidden name=action value='edit'><input type=text name=name value=".$result_obj->name."></td></tr>".
 "<tr><td><h3>Periodcity</h3></td> <td><select name=period>".periodicity($result_obj->period)."</select></td></tr>".
"<tr><td><h3>Category</h3></td><td><select name=cat_ID[0] >".$cats."</select></td></tr>". 
"<tr><td><h3>Location</h3></td><td><input type=text name='location' value=".htmlentities($location_name)."></td><td align=left valign='top'><p class='submit'><input type='button' value='Show' onclick=testdef(location.value)></p><strong>Search Results=</strong><div id='asa'></div><strong> Details</strong><div id='ion'></div></td></tr>".
 "<tr><td><h3>Url</h3></td><td><input type=text name=source[0] size=65 value=".$result_obj->source."></td></tr>".
"<tr><td>&nbsp;</td><td align=right><p class='submit'><input type='submit' name='add' value='Save' /></p></td></tr>".
"</table>";
The value called htmlentites($location_name) is the one which eats out the rest of the string after the spaces
Last edited by dude81 on Tue Feb 20, 2007 12:51 am, edited 1 time in total.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

Ah... I didnt put the quotes. Thanks
Post Reply