text field and mysql .....

A

Anonymous

Guest
hi

little prob...

i wanna insert in a textfield a value in my Db....but when there is more than one word....only the first one appears in the text input...


wot the solution?
 
its not quite clear to me where you're problem lies, my best guess is you have a little html-problem, just yell at me when I still got it wrong :)

You're input field in the html file doesn't contain the default value you expected, try this:
Code:
<input type="text" name="stupidfield" value="default value">

Greetz Daan
 
No in fact i mean....

in my Db fiels i have this value..."my link name" ok..
and then when i put this value in a text files in my form

echo"<td><input name=\"Name1\" type=\"text\" size=\"20\" maxlength=\"20\" value=";
if($Row[Linkname1]){
print($Row[Linkname1]);}
echo"></td>";

i have only the value "my" in my text field.....


shall i add that i have the same prob 4 my update...

thx 4 ur helps
 
cho@ said:
No in fact i mean....
echo"<td><input name="Name1" type="text" size="20" maxlength="20" value=";
if($Row[Linkname1]){
print($Row[Linkname1]);}
echo"></td>";

i have only the value "my" in my text field.....

the value is only "my" because it's not between "
because you use echo like this:
Code:
echo " text to echo "
it is a bit difficult to see what is actually printed to the page and what's not.
perhaps you can use ' like this:
Code:
print('<td><input name="Name1" type="text" size="20" maxlength="20" value="');
if($Row[Linkname1]){
print($Row[Linkname1]);}
print('"></td>');
when using ' you don't have to escape the spacial characters.

Greetz Daan
 
cho@ said:
No in fact i mean....

in my Db fiels i have this value..."my link name" ok..
and then when i put this value in a text files in my form

echo"<td><input name="Name1" type="text" size="20" maxlength="20" value=";
if($Row[Linkname1]){
print($Row[Linkname1]);}
echo"></td>";

i have only the value "my" in my text field.....


shall i add that i have the same prob 4 my update...

thx 4 ur helps
That will simply output:

<td><input name="Name1" type="text" size="20" maxlenght="20" value=my link name"></td>

You forgot the opening quotation marks for the value!

dvdbinternet said:
when using ' you don't have to escape the spacial characters.
Greetz Daan
It's worst than that, special characters are only special between double quotes, single quotes interpret a string literally.
Code:
<?
$string = "This is my string";

print "The string is '$string'\nthat was it"; //Outputs The string is 'This is my string'
that was it

print 'The string is "$string"\nthat was it"; //Outputs The string is "$string"\nthat was it
 
Back
Top