1 Reply Latest reply on Jul 27, 2009 8:29 PM by PeakDigital

    New to Flex - Need help with survey code

    dantheman510

      Hey everyone I am fairly new to flex, as well as forms. I need a little help with how I should go about making this questionnaire I am making for my website. I would like to have 3 or 4 questions and each question should eliminate some possibilities based on their answer so after they submit the form, the product that best fits their answers is shown. I have a hosting account that supports php, mysql, perl, and python and I am not sure which one I should use.

       

      Here is an example of what I want to do:

       

      Is it important that your company is eco-friendly?

      -YES

      -NO

       

      What is your Budget?

      -Less than $5

      -More than $5

       

      Submit (Lets say the visitor clicks on wanting an eco-friendly company for less than $5)

       

      Company 1-Eco-Friendly-$8

      Company 2-Eco-Friendly-$3

      Company 3-Not Eco-Friendly-$4

      Company 4-Not Eco-Friendly-$2

      Company 5-Not Eco-Friedly-$10

       

      On the next page would display Company 2 because it is the only company that fits the visitors criteria.

       

      Can I do this with Flex?

      If so, How?

       

      Thanks for all of your help!

        • 1. Re: New to Flex - Need help with survey code
          PeakDigital Level 1

          I'm new to Flex too, so if I'm wrong on this, hopefully someone more experienced will have some input...

           

          Yes, Flex can do what you need. Do you have experience with or preference for any of the server-side technologies you listed?  As far as I know they all work with Flex. My personal preference is PHP + MySQL. Unless you just want survey responses emailed, you'll need a MySQL database to store them. PHP would be your bridge between the Flex app and the database.

           

          Do some research on the Form and FormItem components in Flex. They make formatting your inputs a lot easier. I would guess from your survey example that you'll also need to utilize the RadioButtonGroup component within your Form.

           

          Depending on your preference, you could either filter your options in ActionScript in an ArrayCollection or XML object, or send the form inputs via HTTPService to a MySQL query in a PHP page (or use PHP to trigger a stored procedure) and return the matching options to be displayed to the user. The second method would probably be slower due to the server transaction time.