Default value input issue
Posted: Tue Aug 22, 2006 9:54 am
I have recently started learning php and have come across a problem that I hope you'll be able to help with. I know its probably an easy one but my head is starting to bleed where Ive been hitting it against the wall.
I am trying to design a form with an input box that has a multi-word default value. I can do this with HTML but for some reason the php code seems to only accept the first word and discards the rest.
In the example above, the first box has the full value but the second box merely contains the word 'This'.
I looked but couldn't find any explaination for this - but maybe thats just me.
Thanks in advance for any assistance.
I am trying to design a form with an input box that has a multi-word default value. I can do this with HTML but for some reason the php code seems to only accept the first word and discards the rest.
Code: Select all
<form >
<input type="text" value="This works fine"/>
<input type="text" value=<?php $mytext="This is useless"; echo "$mytext";?> />
</form>I looked but couldn't find any explaination for this - but maybe thats just me.
Thanks in advance for any assistance.