Building a simple Questionnaire ?

Posted on 2004-11-09
Last Modified: 2010-04-07


I'm looking to construct a simple Questionnaire using Dreamweaver.

Can anybody suggest how I do this?  I would like to keep it as simple as possible but would consider using ASP if beneficial?

I am more concerned how to get to the results from the questionnaire to appear in a nicely formatted email?

Question by:andyw27
    LVL 10

    Expert Comment

    ASP will work quite well if you have CDONTS installed on the server.
    PHP is also quite easy.
    But this is code for asp:

    If Request.ServerVariables("Request_Method") = "POST" then

    Dim objMail
    Dim strBody

     Set objMail = Server.CreateObject("CDONTS.NewMail")

        objMail.From    = "You***************** "
        objMail.Subject = "Thank You*************** "
        objMail.To      = ""

         firstName             = Request.form("fname")
         Lastname             = Request.form("lname")
         emailaddress                      = Request.form("emailaddress")

         HTML = HTML & "<html>"
         HTML = HTML & "<head>"
         HTML = HTML & "</head>"
         HTML = HTML & "<body bgcolor=""FFFFFF""><font size =""2"" face=""Arial"">"
           HTML = HTML & "Thank you" & firstName &" for completing the  Questionnaire.  Your participation in this process is very much appreciated."
           HTML = HTML & "<br>"       
           HTML = HTML & "<hr width=""200"" size=""2"" align=""left"">"
         HTML = HTML & "<p align = ""center"">This email has been auto-generated; Please do not respond.</p>"
           HTML = HTML & "</font></body>"
         HTML = HTML & "</html>"

         objMail.BodyFormat=0 '0= HTML, 1=Text

         objMail.Body = HTML


    'You must always do this with CDONTS.
     set objMail = nothing

    End If

    You should be able to alter this to your needs.
    this is the second page of the process. just create a form on the first page and change the form names to sothing more descriptive. then let that form POST to this page.


    Author Comment


    That's great thank you.

    One other question how can I get the forms feature to interact with the email.  For example if I had say 4 tick boxes how could I get the label and status of tickbox to show in the email which is returned ?

    The same goes for drop down lists ?

    LVL 10

    Expert Comment

    same way, just add like this

    this first part is the variables
                                      this second part is requesting the info that was put into the form fields

         firstName           = Request.form("fname")
         Lastname           = Request.form("lname")
         emailaddress      = Request.form("emailaddress")

         othercheckbox     =Request.form("nameofthecheckbox")

    Hope this helps
    LVL 10

    Accepted Solution

    Has you question been answered?
    if so, please close this question.  



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
    This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now