Hey, I am donering why this line of code:
echo("Apreciated person #$c: <input type=\"text\" name=fname$c value={$_POST['fname'.$c]}><br><br>");
prints only the first word what was entered in field fname on the previous input box?
Anyone know how to correct this problem so that this input box will display all text that was written in the previous input box?
Thanks for all help and advice provided.
Help with a line of code
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You need to put quotes around your value attribute (or better yet all attributes) and then this won't happen:
If you don't put those double quotes in you get something like this produced:
and the browser has no idea that ' or other' have anything to do with the value, whereas it does if you have:
Mac
Code: Select all
echo 'Apreciated person #'.$c.': <input type="text" name="fname'.$c.'" value="'.$_POST['fname'.$c].'" /><br /><br />';Code: Select all
<input type="text" name=fname1 value=something or other>Code: Select all
<input type="text" name="fname1" value="something or other">- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you tried just using of code like:
with all the values hardcoded in to see if that works?
Mac
Code: Select all
<input type="text" name="fname1" value="something or other">Mac
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK