spaces vs in form fields
| From: | Greg | Date: | Mon, 29 Oct 2001 21:32:29 +0000 |
| Subject: | spaces vs in form fields | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-72779@lists.php.net to get a copy of this message | ||
I have a function which takes an integer (the id field for a record) and
returns the corresponding full name of the person whose id matches the
integer.
The function constructs the full name by querying a table for the row which
matches the id and then concatenating firstname, middlename, and lastname
with a " " (space) between each. The name value is called $name.
Once $name is gotten, it may appear under 2 conditions: as an uneditable
displayed value, or as an editable value appearing on a form in an input
text box. Whenever I simply display the value, it appears correctly, e.g.,
"John Paul Smith".
However, when I display the value in an input text box on a form, only
"John" appears. The odd thing is that when I view source, the full name
appears in the HTML; it just doesn't render that way in IE/Opera.
If I concatenate instead of " ", the full name appears correctly in
the form field. That's fine but I have an inverse function which takes the
full name and returns the id. This inverse function works when I use " " to
concatenate names but it doesn't work when I use !
Ugh! What's up with that?
Please REMOVE -NOSPAM from my email address when replying to me. Thanks.