This is a discussion on Text in HTML form only displays first word within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Using PHP & MYSQL, a variable is saved to a row and then fetched again. This process runs ok. But ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Using PHP & MYSQL, a variable is saved to a row and then fetched
again. This process runs ok. But when displaying a text variable in an HTML form within an input='text' box, only the first word is displayed. For example if the variable $description was to contain 'Red square box' onlyh the word 'Red' would appear in the HTML form text box. When this text box is saved to a variable, there is also only one word in it. I've check the contents of the variable being placed into the box and it's always correct. I've also tried setting the 'Size' and 'maxlength' variables in the HTML text box parameters, but to no avail. This happens in both ie 5.5 & Firefox 1.07. I realise that something very simple must be amiss, but I just cant work it out. Any assitance would be greatly appreciated. Thanks Pete... |
|
|||
|
Hi,
In article <0livs19atd9s0metmmkmhqg3l7qi4098ac@4ax.com>, pete<noname@nowhere.com> wrote: > When this text box is saved to a variable, there is also only one word > in it. I've check the contents of the variable being placed into the > box and it's always correct. I've also tried setting the 'Size' and > 'maxlength' variables in the HTML text box parameters, but to no > avail. This happens in both ie 5.5 & Firefox 1.07. > > I realise that something very simple must be amiss, but I just cant > work it out. You are quoting the value in the generated HTML aren't you? <input name="fred" value="a value with spaces in it"> If you don't put quotes around the value, I expect it'll only include the first word. Andy |
|
|||
|
On Thu, 19 Jan 2006 17:42:25 GMT, Andy Hawkins <andy@gently.org.uk>
wrote: >Hi, > >In article <0livs19atd9s0metmmkmhqg3l7qi4098ac@4ax.com>, > pete<noname@nowhere.com> wrote: >> When this text box is saved to a variable, there is also only one word >> in it. I've check the contents of the variable being placed into the >> box and it's always correct. I've also tried setting the 'Size' and >> 'maxlength' variables in the HTML text box parameters, but to no >> avail. This happens in both ie 5.5 & Firefox 1.07. >> >> I realise that something very simple must be amiss, but I just cant >> work it out. > >You are quoting the value in the generated HTML aren't you? > ><input name="fred" value="a value with spaces in it"> > >If you don't put quotes around the value, I expect it'll only include the >first word. > >Andy ....That'll be it then! I knew it was something really obvious, but just couldnt see the wood for the trees! Thanks for your help - hope I can return the favour someday. Pete... |
![]() |
| Thread Tools | |
| Display Modes | |
|
|