Development of WEB survey (voting) system using ASP technology (3)

Source: Internet
Author: User
Tags html form
III. Survey form generation and result analysis
Author: Cactus studio
    
PollWriter. asp first checks the Form variables, including the survey project name PollName and (optional) string LinkText and LinkURL. LinkText and LinkURL describe the URL displayed after the user submits the voting result. Next, the script creates and executes the SQL command to extract the record set from the S _ table and A _ table of the specified survey project, and then traverses the record set format radio button, check box, and other prompt text, finally, output the HTML form of the survey project. The problem name in the form is "CHOICE" and the problem serial number is added. When this form is submitted, its ACTION will load PollMaker. asp (the function saveResponses () Here extracts the voting result from the CHOICE form element, and then updates the database with the code omitted ). Other hidden variables in the form are used to pass PollName, OpType, LinkText, and LinkURL to PollMaker. asp:
    
    
<%
'Read the survey project definition from table S _ and table _
Set objConn = Server. CreateObject ("ADODB. Connection ")
ObjConn. Open "poll"
SQLCommand = "Select" & SName & ". ID ,"&_
"IType, NoOpinion, Stem, ALabel, Answer FROM" & SName & "left join "&_
AName & "ON" & SName & ". ID =" & AName & ". id order "&_
SName & ". ID, ALabel"
Set objRS = objConn. Execute (SQLCommand)
'Output all problems to the survey form
Do While Not objRS. EOF
Response. Write ("<TR> <TD>" & objRS ("ID") & ". <td bgcolor =" "# ffff00" "> "&_
ObjRS ("Stem "))
Response. Write ("<TR> <TD> ")
CkNoOpinion = IIf (objRS ("NoOpinion") = "Y", "", "Checked ")
NoMove = False
'Apart from "allow check", you must check whether you are allowed not to answer questions.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.