Page 1 of 1
Form editing problem
Posted: Tue Feb 20, 2007 12:12 am
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
Posted: Tue Feb 20, 2007 12:17 am
by Luke
sounds to me like you aren't quoting your html attributes... post the code.
Posted: Tue Feb 20, 2007 12:32 am
by feyd
Yep, that definitely sounds like you aren't putting quotes around the attribute values.
Posted: Tue Feb 20, 2007 12:47 am
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> </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
Posted: Tue Feb 20, 2007 12:50 am
by dude81
Ah... I didnt put the quotes. Thanks