Remembering Form data

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Remembering Form data

    I'm just wondering, if it's possible for a form to remember it's data?
    I have a form with several text boxes, as well as 2 dropdowns, one for
    country, and one for provinces and states.
    When the user selects a Country, this.form.submit() is called, which basicaly
    refreshes the page, and loads up all of the provinces or states for that
    country that was selected.
    However, if there was any data in the textboxes, it would be lost.

    Right now, to restore the data, I'm using:
    <cfif form.second_email eq "">
    <input type="text" size="20" name="second_email" />
    <cfelse>
    <input type="text" size="20" name="second_email" value="#form.second_email#"/>
    </cfif>

    This works, but I'm hoping for something cleaner, or for something that was
    made for situations like this.

    Thanks,
    Jay

    Carl J Guest

  2. Similar Questions and Discussions

    1. Autopopulated form not displaying data in pdfunless the form field is clicked
      Within my online application, I have a pdf form that is auto generated and displayed to the user in the browser. My problem is that the populated...
    2. file upload form enctype="multipart/form-data
      I'm upload a file using cffile upload and that seems to work fine except I need to use enctype="multipart/form-data on the form side. This isn't a...
    3. Getting client file name from a submitted form usingmultipart/form-data
      Ive got a simple form with an type="file" -- all works fine, but what i want to do is get the extension of the file uploaded but not have to upload...
    4. mx 7 flash form The form data has expired, Please reloadthis page in your browser.
      When i first go to any flash form on my CFMX 7 server i get the following message. The form data has expired, Please reload this page in your...
    5. Template Column data depending on form data
      Langauage C# I have a webform containing a dropdown control and a datagrid. A different query is fired depending on the value of the dropdown...
  3. #2

    Default Re: Remembering Form data

    > I'm just wondering, if it's possible for a form to remember it's data?
    > I have a form with several text boxes, as well as 2 dropdowns, one for
    > country, and one for provinces and states.
    > When the user selects a Country, this.form.submit() is called, which
    basicaly
    > refreshes the page, and loads up all of the provinces or states for that
    > country that was selected.
    > However, if there was any data in the textboxes, it would be lost.
    >
    I usually use something like this

    <cfparam name="form.primary_email" default="">
    <cfparam name="form.second_email" default="">

    <cfoutput>
    ....
    <input type="text" size="20" name="primary_email"
    value="#form.primary_email#"/>
    <input type="text" size="20" name="second_email"
    value="#form.second_email#"/>
    .....
    </cfoutput>


    _jt Guest

  4. #3

    Default Re: Remembering Form data

    You can use
    <cffrom preservedata="yes"

    deepu_verma 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