Text in HTML form only displays first word

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-19-2006
pete
 
Posts: n/a
Default Text in HTML form only displays first word

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...
Reply With Quote
  #2 (permalink)  
Old 01-19-2006
Andy Hawkins
 
Posts: n/a
Default Re: Text in HTML form only displays first word

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
Reply With Quote
  #3 (permalink)  
Old 01-21-2006
pete
 
Posts: n/a
Default Re: Text in HTML form only displays first word

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...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:50 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0