Professional Web Applications Themes

<CFIF> Statements and Form Action - Coldfusion - Advanced Techniques

Ok, here is what I am trying to accomplish. I am building a Form using Coldfusion in which certain variable will change based on a selection half way through the form. I am asking for name, address, etc.... and those elements will remain constant acorss the form, however a user will choose a (List or Jump Menu?, I can't decide the best way to go on this until I understand how to format this with Coldfusion), and the form fields below that point will change to accodate the questions that address their particular choice. Also, to process the form, the ...

  1. #1

    Default <CFIF> Statements and Form Action

    Ok, here is what I am trying to accomplish. I am building a Form using
    Coldfusion in which certain variable will change based on a selection half way
    through the form. I am asking for name, address, etc.... and those elements
    will remain constant acorss the form, however a user will choose a (List or
    Jump Menu?, I can't decide the best way to go on this until I understand how to
    format this with Coldfusion), and the form fields below that point will change
    to accodate the questions that address their particular choice. Also, to
    process the form, the Form Action will be different based on the choice they
    make. When the fields below the Jump Menu or List change, I need the parts of
    the form they ALREADY filled out like name, address, etc... to remain on the
    form as they already filled it in, and when they are done and click submit, the
    METHOD will be post for all options, but the ACTION will change to the page
    processing the form as it relates to each specific area.

    I don't know how well I explained this, but my question would be:
    1-What is the best CF method to accomplish this: <CFIF> or <CFCASE>
    2-Can I use a standard List or do I need a Jump Menu to initiate the
    Coldfusion?
    3-Can I change the ACTION based on their selection?
    4-Do I need to create variables for the name, address, and other elements that
    will remain constant in order to carry them forward to the extended form after
    their choice is made? If so, what is the best way to do this?

    This is my first bit of CF Programming and I am excited about doing much more,
    but I have run into this little stumbling block. There are easier ways for
    "ME" to do this, but I want this to look as professional as possible and to be
    functional and very efficient.

    Please adivse this CF Newbie! Thanks for all the help out there. I cannot
    tell you how much I appreciate it!

    Sincerely-
    Charles Carter
    com


    ChuckRWD Guest

  2. #2

    Default Re: <CFIF> Statements and Form Action

    CF commands are used to construct the form for presentation at the client.
    Onces it's sent they can no longer intervene.

    If you want something to happen immediately at the client you'll have to get
    into Javascript.

    If you truly want to do everything in CF (Intranet perhaps?), an alternative
    is to force a Form submit, onChange="this.form.submit(); return true;" or
    onClick...... etc., for the desired fields and have your action .cfm page
    rebuild the Form as desired.

    JMGibson3 Guest

  3. #3

    Default Re: <CFIF> Statements and Form Action

    Another approach is to use a multi-part form. You can have the user complete
    the first part (name, address, etc.) and then select whatever option you have
    before going on to part 2.

    Part 2 can display based on these options. The parts they already filled out
    can be stored in hidden form fields for processing when the final form is
    submitted. All of this can be done in ColdFusion with no JavaScript.

    -Paul


    dempster Guest

Similar Threads

  1. <cfif form.secret_word EQ #session.secretWord#> thankyou <cfelse>sorry </cfif>
    By Hydrowizard in forum Coldfusion - Getting Started
    Replies: 4
    Last Post: April 28th, 06:21 PM
  2. <cfif IsDate(FORM.theTestValue)> vs <cfif IsnotDate(FORM.theTestValue)>
    By tiffianypeck in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: April 18th, 07:32 PM
  3. Contribute and <cfif><cfelse> statements
    By wendigo in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: August 17th, 02:08 PM
  4. CFIF statements-why isnt it working???
    By redman2215 in forum Macromedia ColdFusion
    Replies: 1
    Last Post: June 24th, 09:43 PM

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
  •  

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