Web Programming QUestion

Discussion in 'OT Technology' started by Coottie, Apr 22, 2007.

  1. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    For one of my classes, we're recreating facebook.

    I've got group messaing implemented and I'm storing the messages in a mySQL table.

    I'm using JSP, servlets and NetBeans to create the pages.

    I'm working on the group admin part where they can modify any group message, so I'm listing all the messages like this:
    Code:
    <td>
      <form action="groupUpdateGroupMsgResponse" method="post">
        <textarea name="message" rows="10" cols="10">
          <%= rs.getString(5) %> 
        </textarea>
    </td>
    <td>
        <input type="hidden" name="group" value="<%=group %>" >
        <input type="hidden" name="msgId" value="<%=rs.getString(1) %>" >
        <input type="submit" value="Modify">
      </form>
    </td>
    
    The rs.getString(5) line is the string from the result set.

    Now the problem is when I'm using firefox, it's displayed properly in the text area, with the message at the start however IE adds tons of blank characters to the start of the message. I just counted...it's adding 56 blank characters to the start of the string....there are some added to the end but I didn't count them.

    I've verified that the message has NO blanks at the start (in the DB) and I even tried rs.getString(5).trim() to be sure....that didn't help.

    I had to increase the rows to 10 just so I could see the messages in IE properly.

    Anyone know why IE adds all these blank characters and how to fix it??

    Oh and ibIEsux! :)

    EDIT: Ok I also just added a character at the start of all the blanks and one at the end with my original message in tact inbetween these 2 characters. IE strips out all the blanks inbetween these new characters and my message and only puts 1 blank on either side of the original message. WTF??
     
    Last edited: Apr 22, 2007
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    have you tried putting it on one line?
    Code:
    <textarea name="message" rows="10" cols="10"><%= rs.getString(5) %></textarea>
    just a thought.
     
  3. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    :uh: damn...that fixed it. Thanks man. :bigthumb:
     
  4. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Oh yeah, IE doesn't care about XHTML and its "print nothing unless it's specifically tagged as printable" paradigm, so anything in your HTML that isn't contained within a non-printable tag will get displayed onscreen. Fuckers.
     
  5. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    dude ive had that same exact problem in IE so many times :madfawk:
     

Share This Page