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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    # of cols in a text area question.

    Hey. I have a form which is being submitted and the info is sent to a success page. the data entered into the form is displayed in a neat table format suitable for printing. My question is as follows.

    i have a textarea in my form that is configured as follows:
    Code:
    <textarea name="Application_Information" cols="78" rows="12" wrap="HARD" id="textarea" tabindex="16" style="FONT-FAMILY: Georgia, Times New Roman, Times, serif; font-size: 14"></textarea>
    the data entered in it is passed to the success page and displayed in a table configured as such (slightly trimmed down code):
    Code:
    <table width="536px">
          <tr>
            <td width="30%" align="left" valign="top">
               <strong>Application Information:</strong></td>
            <td width="70%" valign="top">
               <pre><font size="2" face="Georgia, Times New Roman, Times, serif">
               {= param.Application_Information =}</font></pre></td>
          </tr>
      </table>
    my problem is that when a user types a full sentence in the text area (uses all 78 cols), the resulting output on the success page moves the divider between the two <td> cells... not respecting the 30% and 70% of the 536 px i have specified.

    how do i make the <td> widths immune to moving around, regardless of whether or not the 78 cols are used or not?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Remove the <pre></pre> tags and replace the embedded CRLF characters with <br> tags.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    wouldnt that only work IF the user hits ENTER? and if they dont it just runs on? <pre> seems to work fine... i just need to make the <td> widths immutable... should i define a pixel width instead of a % width?

    would your suggestion look like this:
    Code:
    <table width="536px">
          <tr>
            <td width="30%" align="left" valign="top">
               <strong>Application Information:</strong></td>
            <td width="70%" valign="top">
               <font size="2" face="Georgia, Times New Roman, Times, serif">
               <br>{= param.Application_Information =}<br></font></td>
          </tr>
      </table>
    Last edited by canadianjameson; 10-13-2004 at 11:03 PM.
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    1,223
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why are you using percentages anyway? You know the width of the parent, and you only have two columns... Just make them pixels.

    30% of 536 = ~161
    536 - 161 = 375

  • #5
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    i tried that, it didnt work. when long sentences are entered into the text are, it still pushes the 30% to about 15%

    here's the code
    Code:
        <table width="536px" style="border: solid 1px black;" cellspacing="0" cellpadding="1">
          <tr>
            <td width="161" style="border-bottom: solid 1px black; border-right: solid 1px black;"><strong>Producer:</strong></td>
            <td width="375" valign="middle" style="border-bottom: solid 1px black;">{=param.Producer =}&nbsp;</td>
          </tr>
          <tr>
            <td width="161" style="border-bottom: solid 1px black; border-right: solid 1px black;"><strong>Product: </strong></td>
            <td width="375" valign="middle" style="border-bottom: solid 1px black;">{=param.Product =}&nbsp;</td>
          </tr>
          <tr>
            <td width="161" style="border-bottom: solid 1px black; border-right: solid 1px black;"><strong>Quantity:</strong></td>
            <td width="375" valign="middle" style="border-bottom: solid 1px black;">{=param.Quantity =}&nbsp;</td>
          </tr>
          <tr>
            <td width="161"align="left" valign="top" style="border-right: solid 1px black;"><strong>Application Information:</strong></td>
            <td width="375" valign="top">
    <pre><font size="2" face="Georgia, Times New Roman, Times, serif">{= param.Application_Information =}</font></pre></td>
          </tr>
      </table>
    check it for yourself. enter alot of data in the text field and hit submit.
    www.enviromark.ca/english/quoteform.html
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try it without the <pre></pre> tags and see if it still shows that problem.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #7
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    fixed it, thx aaron

    go canada!
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #8
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Roy, you were right

    evil <pre> tags
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #9
    Regular Coder
    Join Date
    May 2004
    Location
    Minneapolis, MN, USA
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The only evil tags I saw started with <font...

  • #10
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    and perhaps <head> and <body> . . .

    *shifty eyed look around*

    where are the <feet>, hmmmMM?!

    i dont trust them feetless entities... constantly plotting
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #11
    Regular Coder
    Join Date
    May 2004
    Location
    Minneapolis, MN, USA
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts
    uh...

  • #12
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Roy. i realised after i msg'd you that perhaps i should have posted it here. sorry

    i'll do both.
    Roy:

    you helped me fix my problem regarding <pre> tags (et al.) on this thread
    however now the resulting form output does not display any ENTER keystrokes. you suggested something (bolded), but i didnt know what you meant
    Quote Originally Posted by Roy Sinclair
    Remove the <pre></pre> tags and replace the embedded CRLF characters with <br> tags.
    i was wondering if you could just elaborate, or show me how to do it.

    the output page with (i think) the "CRLF" characters is this:
    Code:
    <table width="536px">
          <tr>
            <td width="30%" align="left" valign="top">
               <strong>Application Information:</strong></td>
            <td width="70%" valign="top">
               <pre><font size="2" face="Georgia, Times New Roman, Times, serif">
               {= param.Application_Information =}</font></pre></td>
          </tr>
      </table>
    wouldn't replacing the {= tags with <br> tags kill the effect? i assume '{=' is like '<'
    Thanks, and sorry again for the double post
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #13
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, you don't want to replace the {= and =} tags, those appear to be part of your server side code. It's the data inside param.Application_Information that needs to have it's embedded CRLF's replaced by <br> tags using the appropriate server side code.

    For example you have the following text (^CRLF will represent in the example text where an actual carriage return and linefeed sequence would appear:

    Line 1^CRLFLine 2^CRLF^CRLFLine 3

    What you need to output to the html page is:

    Line 1<br />Line 2<br /><br />Line 3

    In ASP, I would code that as <%= Replace(param.Application_Information,vbCRLF,"<br />")%> but your server side code is obviously not ASP so you need to find the equivalent in your server side language and use it.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #14
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    I took your advice and moved the question to the Perl / CGI forum.

    Thanks Roy, much appreciated.

    http://www.codingforums.com/showthre...457#post247457

    Hope i can get this working so my bid to have the sexiest, most functional web page can continue on its merry way
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #15
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Roy, i posted my question to the people who wrote the TFMail script. although their answer was less than helpfull on the perl end, they did suggest something that i found interesting. i wanted your opinion on whether it would work: i bolded it. it would involve putting back in the <PRE> tags

    > i'm having a problem with TFMail. I have a text field on a form that
    > is being displayed on a success page. The problem is that the ENTER
    > keystrokes entered on the form are not being transfered over to the
    > success page

    Yes that is correct. Browser don't care about whitespace (and an enter
    is whitespace). It is not a problem with TFMail.

    >
    > i was told that in ASP you'd use this: <%= Replace(param.Application_Information,vbCRLF,"<br />")%> instead of this: {= param.Application_Information =}.
    >
    > What would the correct syntax be for this script? unless it's been
    > fixed in the new version of the script.
    >

    There is no syntax and it is not something we can 'fix' - we do not know
    how people are going to use the output of the program and having it
    'fixed' to insert arbitrary characters in the form input is likely to
    break things for other people.

    What we would recommend is that you put the output into a <div /> block
    and use CSS to restrict the width so that it wraps inside the DIV.

    e.g.

    <div style="width: 80%;">
    {= param.Application_Information =}
    </div>

    and that should do the job.

    /J\
    Thanks Roy
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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