blank spaces in text fields in form

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default blank spaces in text fields in form

    I am a newbie. I have a simple form with just a few fields. A user fills out
    the form, goes to another page to preview his/her entries, and then may choose
    to return to the form and make changes in those fields. I use session variables
    to do this. So I want the form to be filled with the session variable data when
    a user returns but be completely blank upon first entry to the page. That part
    works OK. But I'm getting lots of blank spaces in all my text fields when you
    first enter the page, and even more added when you return to the form after
    filling it out the first time. Here's my code for one sample field in the
    form... all have similar code: Please enter your personal message<br>
    <textarea name='txtMessage' cols='65' rows='2' id='txtMessage'> <cflock
    scope='Session' timeout='10' type='readOnly'> <cfif
    IsDefined('session.sessMessage')><cfoutput>#Sessio n.sessMessage#</cfoutput></cfi
    f> <cfif Not IsDefined('session.sessMessage')><cfset session.sessMessage =
    ''></cfif></cflock></textarea> I've tried using Trim but that seems to make no
    difference. Thanks in advance for anyone's help!

    kb'sbuddy Guest

  2. Similar Questions and Discussions

    1. linking form text fields
      hello: does anyone know if there's any way to link text fields in a form? in other words, once the user runs of of space in one field, the cursor...
    2. Blank Spaces in the Score?
      I know this is pretty basic and vague, but I have some scenes in my movie that automaticall play strung together with lingo that run in this order. ...
    3. Trimming Blank Spaces in String
      You can use the VB.NET function RTRIM. -- I hope this helps, Steve C. Orr, MCSD http://Steve.Orr.net "Temp" <tempmail@temp.com> wrote in...
    4. ASP & Mysql - Problem with blank text fields
      I hadn't realized I had invalid information in my mail client, I have updated it and have re-posted to provide accurate information. "Test"...
    5. Blank form fields passed to SQL
      In your sql statement, check if the value is empty. I don't know what scripting language you are using so I will give an example using coldfusion ...
  3. #2

    Default Re: blank spaces in text fields in form

    Note that everything between the ">" at the end of the first line and
    </textarea> becomes fair game to pre-populate your textarea box. To get rid of
    those spaces, try the code below.



    <!--- leave NO spaces between your ColdFusion tags. spaces WITHIN the tags
    are OK --->

    <textarea name="txtMessage" cols="65" rows="2" id="txtMessage"><cflock
    scope="Session" timeout="10" type="readOnly"><cfif
    IsDefined('session.sessMessage')><cfoutput>#Sessio n.sessMessage#</cfoutput></cfi
    f><cfif Not IsDefined('session.sessMessage')><cfset session.sessMessage =
    ""></cfif></cflock></textarea>

    jdeline Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139