Conditional Form Fields (CF8)

Discussion in 'Programming' started by Sushi_Master, Apr 1, 2009.

  1. #1
    We have recently upgraded to coldfusion 8 and I'm looking to do a little more with my online forms, to make them easier for the end user.

    The first feature I'd like to tackle is displaying some form fields, conditional to the input on another field.

    i.e. Do you have a car? Yes [ ] No [ ]

    IF the user selects yes another form field shows up, which was previously hidden.

    i.e. What car do you have?

    I've have got this to work using CFWINDOW which is far from ideal, but i'm sure there must be a better way.

    Thanks in advance for your help.
     
    Sushi_Master, Apr 1, 2009 IP
  2. jbird4k

    jbird4k Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Actually, a javascript lib is the best way to do this. I use prototype, and the slider.js in a questionnaire app to accomplish this. if the answer is yes or no what ever you prefer then slides open addition questions
     
    jbird4k, Apr 1, 2009 IP
  3. robhustle

    robhustle Peon

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    A simple way to hack this up too is to use javascript to modify the display property of a div tag surrounding the form elements.
     
    robhustle, Apr 5, 2009 IP