Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Handling space character in Forms

    This is probably a simple question but I am struggling and would appreciate help please.

    I have a MySQL database and am retrieving data using PHP.

    When I display the last name of people I use the following line in my Form....
    Code:
    <td class=\"main_body_med\" width=\"150\" align=\"center\">" . $row["last_name"]."</td>
    This displays the name correctly even when the name has a space in it (for example the surname is "Foster Jones").

    However, when I wish to amend the details of the person and I use the following line in my Form....
    Code:
    <td><input type=\"text\" name=\"last_name\" size=\"30\" value = ".$row["last_name"]." ></td>
    only the first part of the surname ("Foster") is displayed.

    Can someone please advise me how to display the full name on the amendment Form? (Note that the amendment does work even changing the surname)

  • #2
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post
    you forgot to put "" quotes
    <td><input type=\"text\" name=\"last_name\" size=\"30\" value = \"".$row["last_name"]."\" ></td>
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs

  • #3
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks very much for your help. How silly of me!!! Thank you adarshakb for spotting my faux-pas. Much appreciated.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •