SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2003
    Location
    uk
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with <input> tag

    Hi,

    I'm not sure if this is the right forum for this post ... but:

    I've got an AJAX thing going on so that when the user clicks on an 'event', javascript calls a php script which generates html and presents a new <div> for the user to edit the 'event' ...

    problem is, if the 'event' text was My birthday then the html returned from the php code would look like this:
    <input id=b_Thing_Desc name=b_Thing_Title size=30 value= My Birthday> </td>

    so far, so good .... but, when displaying that html the input tag would only contain the My word and not the Birthday word too...

    It's the same in FF and IE6.

    any ideas??

  2. #2
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I would suggest that was a problem with your server side code than anything else, i should take a look at that to make sure it is returning what you want properly.

    Next thing to look at would be the javascript that makes the AJAX call and make sure it is passing the full value to the server side script.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2003
    Location
    uk
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got an 'alert' in my javascript that shows me what's coming back from the server ... it's exactly as it should be , i.e.

    <input id=b_Thing_Desc name=b_Thing_Title size=30 value= My Birthday></td>

    it seems that the browsers (maybe, somehow??) decides only to show the first word i.e. 'My' and not 'My birthday' ...

  4. #4
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try putting quotes around the value. i.e. "My Birthday".

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2003
    Location
    uk
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    quotes seemed to do it!

    thanks very much for your help!!


Bookmarks

Posting Permissions

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