Help with a line of code

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Help with a line of code

Post by nigma »

I am having trouble with this line of code:
echo("Unapreciated person #$c: <input type=\"text\" name=ename$c value={$_POST['ename'.$c]}><br><br>");

This will display the first word the user typed into that input box on the last page but will not display any other words after a space.

Anyone know how to make it so this line will do the same thing just will print everything the user typed ( in the input box on the last page ) into another input box?

Thanks for all help provided.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

that's why you should quote any property of an html-element.
If not, someone dislikes me and enters Volker Krause you have

Code: Select all

Unapreciated person #1 &lt;input type="text" name=ename1 value=Volker Krause&gt;
and there's no way for the client to determine that Krause has anything to do with name.

Code: Select all

echo 'Unapreciated person #', $c, ': <input type="text" name="ename', $c, '" value="', $_POST['ename'.$c], ' /><br /><br />';
Last edited by volka on Wed Feb 26, 2003 8:59 am, edited 1 time in total.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

Still just get the first word of what is entered in previous input box. Everything else is either cut off or not visible.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

what's the output as seen by the client (source view of the browser)?
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

In the input box where the text from previous input box was supposed to be it says( when I view source ) just the first word as the value.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

so even in the page source (menu->view->"page source" or similar) the other words are missing?
can you please post that code-snippet?
Post Reply