Having custom validator and Required Field Validators together?

I have a quiz that has a few required field validators and one custom validator.  The custom validator is currently not working--is there some way I need to combine these to make them both work?  Thanks--I've included the code below:

<asp:CustomValidator ValidationGroup="Group2" ID="schoolName" runat="server" ClientValidationFunction="isValidName"
            ErrorMessage="You must enter a value in the following field:"></asp:CustomValidator>
 
<asp:Button ID="b1" Text="Submit" runat="server" />
                        <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="false"
                            HeaderText="You must enter a value in the following fields:" EnableClientScript="true"
                            runat="server" />
                     </asp:Panel>

Open in new window

jianxin9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anurag ThakurTechnical ManagerCommented:
customvalidators onservervalidate has to be set and the logic has to be added in the code behind to handle it
0
amxCommented:
ValidationGroup="Group2" should be removed from the custom validator

But if the other validators are set to ValidationGroup="Group2" then make sure that the ValidationSummary has ValidationGroup="Group2"
0
jianxin9Author Commented:
Thanks for posting! Okay, I don't know if I have this right.  I have removed "validation group="group 2" from the custom validator--I don't have any other validators set to Group 2.  But now that I've done this, none of my validation is working.
<asp:CustomValidator ID="schoolName" runat="server" ClientValidationFunction="isValidName"
            ErrorMessage="You must enter a value in the following field:"></asp:CustomValidator>
 
  <asp:Button ID="b1" Text="Submit" runat="server" />
                        <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="false"
                            HeaderText="You must enter a value in the following fields:" EnableClientScript="true"
                            runat="server" />

Open in new window

0
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

amxCommented:
ok so its either to do with setting the ValidationGroup on your other validators or there is a problem with the javascript function you wrote for the validator.

Can you post the the whole page so i can workout the problem
0
jianxin9Author Commented:
Sure, I appreciate you taking a look at it.
<%@ Page Language="c#" Debug="true"%>
 
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Net" %>
 
<script runat="server" language="C#">
 
private void Page_Load(object sender, EventArgs e)
{
        status.Attributes.Add("onclick", "showHide();");
        Page.ClientScript.RegisterStartupScript(this.GetType(), "OnLoadHandler", "showHide();", true);
 
        if (Page.IsPostBack)
        {
                questionsPanel.Visible = false;
                Message.Visible = true;  
                int correct = 0;
                if (q1.SelectedIndex == 2) correct++;
                if (q2.SelectedIndex == 4) correct++;
                if (q3.SelectedIndex == 2) correct++;
                if (q4.SelectedIndex == 0) correct++;
                if (q5.SelectedIndex == 5) correct++;
                if (q6.SelectedIndex == 1) correct++;
                if (q7.SelectedIndex == 2) correct++;
 
                LoadConn(correct);
        }
        else
        {
                questionsPanel.Visible = true;
                Message.Visible = false;  
        }
}
 
private void LoadConn(int score)
{
    int percent;
    percent = (score*100)/7;  
  
    // Create the objects 
    OleDbConnection conn;
    OleDbCommand comm;
    
    // Instance the connection open it
    conn = new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; Data Source ="+ Server.MapPath("")+";User Id=; Jet OLEDB:Database Password=;");
    conn.Open();
    
    // Create the insert SQL 
    string sSQL = "";
		string qname = "plagiarism"; 
    sSQL = "Insert into posttest_table(fname,lname,username,coursenum,emailId,emailId2,status,school,qname,answered,score,q1,q2,q3,q4,q5,q6,q7) values('" + fname.Text + "','" + lname.Text +"','" + portal_id.Text +"','"+course_id.Text+"','"+emailId.Text+"','"+emailId2.Text+"','"+status.Text+"','"+ school.Text +"','"+(qname)+"',"+score+","+percent+","+(q1.SelectedIndex+1)+","+(q2.SelectedIndex+1)+","+(q3.SelectedIndex+1)+","+(q4.SelectedIndex+1)+","+(q5.SelectedIndex+1)+","+(q6.SelectedIndex+1)+","+(q7.SelectedIndex+1)+");";
   
    //  Response.Write(sSQL + "<br />");
    //  Response.End();
    //  return;
    
    // Create a command object from the connection
    comm = conn.CreateCommand ();
    comm.CommandText = sSQL;
    comm.CommandType = CommandType.Text;
 
    // Try the insert 
    try
    {
        comm.ExecuteNonQuery();
    }
    catch (Exception ex)
    {
        Response.Write("Error During DB Update: " + ex.ToString());
    }
    
    
   
    conn.Close();
    // Inserting data into the database end
     
    // Create the email body text
/* String bodyInfo = fname.Text+" "+lname.Text+" has taken the exam.\n <br />"+fname.Text  +" has scored: "+percent+" out of 100 and gotten "+score+" out of 7 questions correct.\n<br /><br />"+fname.Text  +"'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option 3)<br /> You Answered:  Option "+(q1.SelectedIndex+1)+"\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option 5) <br />You Answered: Option "+(q2.SelectedIndex+1)+"\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option 3) <br />You Answered: Option "+(q3.SelectedIndex+1)+"\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option 1) <br />You Answered: Option "+(q4.SelectedIndex+1)+"\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option 6) <br />You Answered: Option "+(q5.SelectedIndex+1)+"\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option 2) <br />You Answered: Option "+(q6.SelectedIndex+1)+"\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option 3) <br /> You Answered: Option "+(q7.SelectedIndex+1);*/
 
 String bodyInfo = fname.Text+" "+lname.Text+" is a/an "+status.Text+", and has taken the exam for the course "+course_id.Text+".\n <br />"+fname.Text+" has scored: "+percent+" out of 100 and gotten "+score+" out of 7 questions correct.\n<br /><br />"+fname.Text  +"'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option c)<br /> You Answered:  Option "+Convert.ToChar(q1.SelectedIndex+97)+"\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option e) <br />You Answered: Option "+Convert.ToChar(q2.SelectedIndex+97)+"\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option c) <br />You Answered: Option "+Convert.ToChar(q3.SelectedIndex+97)+"\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option a) <br />You Answered: Option "+Convert.ToChar(q4.SelectedIndex+97)+"\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option f) <br />You Answered: Option "+Convert.ToChar(q5.SelectedIndex+97)+"\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option b) <br />You Answered: Option "+Convert.ToChar(q6.SelectedIndex+97)+"\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option c) <br /> You Answered: Option "+Convert.ToChar(q7.SelectedIndex+97);
 
 
    // Create SMTP client
    SmtpClient client = new SmtpClient("");
        
    // Create SMTP message
    MailMessage message = new MailMessage();
 
        // Set message properties 
    message.From = new MailAddress ("");
    message.To.Add("");
    message.CC.Add(emailId.Text);
   if (!string.IsNullOrEmpty(emailId2.Text))
    {
       message.CC.Add(emailId2.Text);
    }
    message.Body = bodyInfo;
    message.Subject = "Doing Research: Plagiarism Quiz Results";
    message.IsBodyHtml = true;
   
    try
        {
 
            // Send EMail
            client.Send(message);
        }
        catch (Exception ex)
        {
            // Do Nothing  
        }
				
 
    // Send the user to the Results page
    Response.Redirect("results.aspx?fname="+fname.Text+"&lname="+lname.Text+"&score="+percent+"&q1="+(q1.SelectedIndex)+"&q2="+(q2.SelectedIndex)+"&q3="+(q3.SelectedIndex)+"&q4="+(q4.SelectedIndex)+"&q5="+(q5.SelectedIndex)+"&q6="+(q6.SelectedIndex)+"&q7="+(q7.SelectedIndex));
 
}
 
 
 
  </script>
 
 
 
 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Doing Research: Plagiarism Quiz</title>
    <meta name="Description" content="Texas Woman's University, with campuses in Denton, Dallas, and Houston, offers bachelor's, master's, and doctoral degrees to its students in the health sciences, the liberal arts, the fine arts, the sciences, and business." />
    <meta name="Keywords" content="texas woman's university, TWU, web guidelines, webspinners" />
    <link href="http://www.twu.edu/library/css/screen.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="http://www.twu.edu/library/css/print.css" rel="stylesheet" type="text/css" media="print" />
    <link href="http://www.twu.edu/library/css/all2_tab.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="http://www.twu.edu/library/js/TAB_Function_Lib.js"></script>
 
 
<script type="text/javascript" language="javascript">
        function showHide() {
            var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
 
            if (rows[3].checked)
                document.getElementById('<%=school.ClientID%>').style.display = "block";
            else
                document.getElementById('<%= school.ClientID%>').style.display = "none";
        }
 
 
        function isValidName(sender, args) {
            var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
 
            if (rows[3].checked) {
                var txt = document.getElementById('<%=school.ClientID%>');
                args.IsValid = (txt.value.length > 0);
            }
        }
    </script>
 
 
 
 
 
    <style type="text/css">
        #Layer1 {
	        position:absolute;
	        width:186px;
	        height:18px;
	        z-index:3;
	        left: 407px;
	        top: 85px;
        }
        #Layer2 {
	        position:absolute;
	        width:421px;
	        height:30px;
	        z-index:4;
	        left: 603px;
	        top:78px;
        }
        .style1 {
	        font-size: 10px;
x	        color: #FFFFFF;
        }
        .style2 {font-size: 10px}
    </style>
</head>
 
 <body onUnload="TAB_GLOBAL_UNINITIALIZE(Array(Example));">
 
    </div>
<!-- InstanceBeginEditable name="content" -->
     <h2>Doing Research: Plagiarism Final</h2>
 <div class="heading">Please Enter Your Information</div>
<Fieldset>
<legend>Please provide the following. Items marked with * are required.</legend>
<form id="Form1" name="ctl00" method="post" action="default.aspx" runat="server">
                    <asp:label id="Message" runat="server" />
 
                        <asp:Panel id = "questionsPanel" runat ="server">
                        <asp:Label ID="Errors" runat="server" />
                        First Name:*<br />
                        <asp:TextBox ID="fname" runat="Server" /><br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="fname"
                            ErrorMessage="First Name" runat="server" Text="*First Name Required"></asp:RequiredFieldValidator>
                        <br />
                        Last Name:*<br />
                        <asp:TextBox ID="lname" runat="Server" /><br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="lname"
                            ErrorMessage="Last Name" runat="server" Text="*Last Name Required"></asp:RequiredFieldValidator>
                        <br />
				<asp:CustomValidator ValidationGroup="Group2" ID="schoolName" runat="server" ClientValidationFunction="isValidName"
        ErrorMessage="If you are a guest, please enter your school name."></asp:CustomValidator>
<br />
				Status*:<br />
    
						
        <asp:RadioButtonList ID="status" RepeatDirection="Horizontal" runat="server">
				<asp:ListItem id="undergrad" Value="undergraduate"></asp:ListItem>
            <asp:ListItem id="grad" Value="graduate"></asp:ListItem>
            <asp:ListItem id="fs" Value="faculty/staff"></asp:ListItem><asp:ListItem id="guest" Value="guest user"></asp:ListItem>
        </asp:RadioButtonList>
    
<br /><br />
           <asp:TextBox runat="server" ID="school"></asp:TextBox>
             <br /><br />
                        <br />             Portal Username: (optional)<br />
                        <asp:TextBox ID="portal_id" runat="Server" />
                        <br />
                        <br />
												Course Name, Number and Section: (optional-ex. ENG-1023.15)<br />
                        <asp:TextBox ID="course_id" runat="Server" />
                        <br />
                        <br />
                        Your Email Address:* (a copy of your results will be sent to this address)<br />
                        <asp:TextBox ID="emailId" runat="Server" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="emailId"
                            ErrorMessage="Email" runat="Server" Text="*Email Address Is Required"></asp:RequiredFieldValidator><br />
                        <br />
                        Your Professor's Email Address: (optional-send your results to your professor)<br />
                        <asp:TextBox ID="emailId2" runat="Server" />
                        <br />
                        <p>
              
             
										  Please choose the best answer.</p>
                        <p>
                            1. Plagiarism is the act of:
                            <br />
                            <asp:RadioButtonList ID="q1" runat="server">
                                <asp:ListItem id="q1a" runat="server" Value="a. using someone else's work and citing it" />
                                <asp:ListItem id="q1b" runat="server" Value="b. using copyrighted materials for your paper" />
                                <asp:ListItem id="q1c" runat="server" Value="c. using someone else's work and not giving them credit" />
                                <asp:ListItem id="q1d" runat="server" Value="d. paraphrasing" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            2. Which of the following is copyrighted infringement?
                            <br />
                            <asp:RadioButtonList ID="q2" runat="server">
                                <asp:ListItem id="q2a" runat="server" Value="a. photocopying a college textbook" />
                                <asp:ListItem id="q2b" runat="server" Value="b. burning a CD that you did not own" />
                                <asp:ListItem id="q2c" runat="server" Value="c. downloading music or movies that you did not pay for" />
                                <asp:ListItem id="q2d" runat="server" Value="d. buying and submitting papers that you did not write" />
                                <asp:ListItem id="q2e" runat="server" Value="e. all of the above" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            3. Accidental plagiarism is:
                            <br />
                            <asp:RadioButtonList ID="q3" runat="server">
                                <asp:ListItem id="q3a" runat="server" Value="a. acceptable one time, as long as it was only an accident" />
                                <asp:ListItem id="q3b" runat="server" Value="b. okay if you paraphrased or changed the text a bit" />
                                <asp:ListItem id="q3c" runat="server" Value="c. always unacceptable" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            4. When citing my resources it is important that I:
                            <br />
                            <asp:RadioButtonList ID="q4" runat="server">
                                <asp:ListItem id="q4a" runat="server" Value="a. use a standard citation format assigned by your professor" />
                                <asp:ListItem id="q4b" runat="server" Value="b. include only the title and year" />
                                <asp:ListItem id="q4c" runat="server" Value="c. use footnotes, in-text citations, and italics for every citation" />
                                <asp:ListItem id="q4d" runat="server" Value="d. all of the above" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            5. RefWorks can help you:
                            <br />
                            <asp:RadioButtonList ID="q5" runat="server">
                                <asp:ListItem id="q5a" runat="server" Value="a. organize your research" />
                                <asp:ListItem id="q5b" runat="server" Value="b. only when you are using the MLA citation style" />
                                <asp:ListItem id="q5c" runat="server" Value="c. import references from many different data sources" />
                                <asp:ListItem id="q5d" runat="server" Value="d. create bibliographies using several citation styles" />
                                <asp:ListItem id="q5e" runat="server" Value="e. all of the above" />
                                <asp:ListItem id="q5f" runat="server" Value="f. a, c, d" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            6. Which of the following best describes plagiarism?
                            <br />
                            <asp:RadioButtonList ID="q6" runat="server">
                                <asp:ListItem id="q6a" runat="server" Value="a. A temporary fix until you have time to re-do the work" />
                                <asp:ListItem id="q6b" runat="server" Value="b. It's a serious offense and can result in severe penalties" />
                                <asp:ListItem id="q6c" runat="server" Value="c. It's easy to commit and not easy to detect" />
                                <asp:ListItem id="q6d" runat="server" Value="d. a and b" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            7. When do you have to cite your resources?
                            <br />
                            <asp:RadioButtonList ID="q7" runat="server">
                                <asp:ListItem id="q7a" runat="server" Value="a. when what you are writing about is your own experience" />
                                <asp:ListItem id="q7b" runat="server" Value="b. when what you are writing about is common knowledge" />
                                <asp:ListItem id="q7c" runat="server" Value="c. when what you are writing about is someone else's idea" />
                            </asp:RadioButtonList>
                        </p>
                   
  <asp:Button ID="b1" Text="Submit" runat="server" />
                        <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="false"
                            HeaderText="You must enter a value in the following fields:" EnableClientScript="true"
                            runat="server" />
                     </asp:Panel>
                   </form>
 <!-- InstanceEndEditable --></td>
  </tr>
  <tr>
    <td id="footer"></td>
  </tr>
</table>
 
 
</body>
<!-- InstanceEnd -->
</html>

Open in new window

0
amxCommented:
I've updated your code.

small change to the javascript
changed the summary tag to show the summary on the page
removed the validation group tag from the custom validator

you might want to consider using a regular expression validator as well for the email address
<%@ Page Language="c#" Debug="true"%>
 
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Net" %>
 
<script runat="server" language="C#">
 
private void Page_Load(object sender, EventArgs e)
{
        status.Attributes.Add("onclick", "showHide();");
        Page.ClientScript.RegisterStartupScript(this.GetType(), "OnLoadHandler", "showHide();", true);
 
        if (Page.IsPostBack)
        {
                questionsPanel.Visible = false;
                Message.Visible = true;  
                int correct = 0;
                if (q1.SelectedIndex == 2) correct++;
                if (q2.SelectedIndex == 4) correct++;
                if (q3.SelectedIndex == 2) correct++;
                if (q4.SelectedIndex == 0) correct++;
                if (q5.SelectedIndex == 5) correct++;
                if (q6.SelectedIndex == 1) correct++;
                if (q7.SelectedIndex == 2) correct++;
 
                LoadConn(correct);
        }
        else
        {
                questionsPanel.Visible = true;
                Message.Visible = false;  
        }
}
 
private void LoadConn(int score)
{
    int percent;
    percent = (score*100)/7;  
  
    // Create the objects 
    OleDbConnection conn;
    OleDbCommand comm;
    
    // Instance the connection open it
    conn = new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; Data Source ="+ Server.MapPath("")+";User Id=; Jet OLEDB:Database Password=;");
    conn.Open();
    
    // Create the insert SQL 
    string sSQL = "";
		string qname = "plagiarism"; 
    sSQL = "Insert into posttest_table(fname,lname,username,coursenum,emailId,emailId2,status,school,qname,answered,score,q1,q2,q3,q4,q5,q6,q7) values('" + fname.Text + "','" + lname.Text +"','" + portal_id.Text +"','"+course_id.Text+"','"+emailId.Text+"','"+emailId2.Text+"','"+status.Text+"','"+ school.Text +"','"+(qname)+"',"+score+","+percent+","+(q1.SelectedIndex+1)+","+(q2.SelectedIndex+1)+","+(q3.SelectedIndex+1)+","+(q4.SelectedIndex+1)+","+(q5.SelectedIndex+1)+","+(q6.SelectedIndex+1)+","+(q7.SelectedIndex+1)+");";
   
    //  Response.Write(sSQL + "<br />");
    //  Response.End();
    //  return;
    
    // Create a command object from the connection
    comm = conn.CreateCommand ();
    comm.CommandText = sSQL;
    comm.CommandType = CommandType.Text;
 
    // Try the insert 
    try
    {
        comm.ExecuteNonQuery();
    }
    catch (Exception ex)
    {
        Response.Write("Error During DB Update: " + ex.ToString());
    }
    
    
   
    conn.Close();
    // Inserting data into the database end
     
    // Create the email body text
/* String bodyInfo = fname.Text+" "+lname.Text+" has taken the exam.\n <br />"+fname.Text  +" has scored: "+percent+" out of 100 and gotten "+score+" out of 7 questions correct.\n<br /><br />"+fname.Text  +"'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option 3)<br /> You Answered:  Option "+(q1.SelectedIndex+1)+"\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option 5) <br />You Answered: Option "+(q2.SelectedIndex+1)+"\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option 3) <br />You Answered: Option "+(q3.SelectedIndex+1)+"\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option 1) <br />You Answered: Option "+(q4.SelectedIndex+1)+"\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option 6) <br />You Answered: Option "+(q5.SelectedIndex+1)+"\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option 2) <br />You Answered: Option "+(q6.SelectedIndex+1)+"\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option 3) <br /> You Answered: Option "+(q7.SelectedIndex+1);*/
 
 String bodyInfo = fname.Text+" "+lname.Text+" is a/an "+status.Text+", and has taken the exam for the course "+course_id.Text+".\n <br />"+fname.Text+" has scored: "+percent+" out of 100 and gotten "+score+" out of 7 questions correct.\n<br /><br />"+fname.Text  +"'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option c)<br /> You Answered:  Option "+Convert.ToChar(q1.SelectedIndex+97)+"\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option e) <br />You Answered: Option "+Convert.ToChar(q2.SelectedIndex+97)+"\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option c) <br />You Answered: Option "+Convert.ToChar(q3.SelectedIndex+97)+"\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option a) <br />You Answered: Option "+Convert.ToChar(q4.SelectedIndex+97)+"\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option f) <br />You Answered: Option "+Convert.ToChar(q5.SelectedIndex+97)+"\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option b) <br />You Answered: Option "+Convert.ToChar(q6.SelectedIndex+97)+"\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option c) <br /> You Answered: Option "+Convert.ToChar(q7.SelectedIndex+97);
 
 
    // Create SMTP client
    SmtpClient client = new SmtpClient("");
        
    // Create SMTP message
    MailMessage message = new MailMessage();
 
        // Set message properties 
    message.From = new MailAddress ("");
    message.To.Add("");
    message.CC.Add(emailId.Text);
   if (!string.IsNullOrEmpty(emailId2.Text))
    {
       message.CC.Add(emailId2.Text);
    }
    message.Body = bodyInfo;
    message.Subject = "Doing Research: Plagiarism Quiz Results";
    message.IsBodyHtml = true;
   
    try
        {
 
            // Send EMail
            client.Send(message);
        }
        catch (Exception ex)
        {
            // Do Nothing  
        }
				
 
    // Send the user to the Results page
    Response.Redirect("results.aspx?fname="+fname.Text+"&lname="+lname.Text+"&score="+percent+"&q1="+(q1.SelectedIndex)+"&q2="+(q2.SelectedIndex)+"&q3="+(q3.SelectedIndex)+"&q4="+(q4.SelectedIndex)+"&q5="+(q5.SelectedIndex)+"&q6="+(q6.SelectedIndex)+"&q7="+(q7.SelectedIndex));
 
}
 
 
 
  </script>
 
 
 
 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Doing Research: Plagiarism Quiz</title>
    <meta name="Description" content="Texas Woman's University, with campuses in Denton, Dallas, and Houston, offers bachelor's, master's, and doctoral degrees to its students in the health sciences, the liberal arts, the fine arts, the sciences, and business." />
    <meta name="Keywords" content="texas woman's university, TWU, web guidelines, webspinners" />
    <link href="http://www.twu.edu/library/css/screen.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="http://www.twu.edu/library/css/print.css" rel="stylesheet" type="text/css" media="print" />
    <link href="http://www.twu.edu/library/css/all2_tab.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="http://www.twu.edu/library/js/TAB_Function_Lib.js"></script>
 
 
<script type="text/javascript" language="javascript">
    function showHide() {
        var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
 
        if (rows[3].checked)
            document.getElementById('<%=school.ClientID%>').style.display = "block";
        else
            document.getElementById('<%= school.ClientID%>').style.display = "none";
    }
 
 
    function isValidName(sender, args) {
        var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
        args.IsValid = false;
        if (rows[3].checked) {
            var txt = document.getElementById('<%=school.ClientID%>');
            args.IsValid = (txt.value.length > 0);
        }
    }
    </script>
 
 
 
 
 
    <style type="text/css">
        #Layer1 {
	        position:absolute;
	        width:186px;
	        height:18px;
	        z-index:3;
	        left: 407px;
	        top: 85px;
        }
        #Layer2 {
	        position:absolute;
	        width:421px;
	        height:30px;
	        z-index:4;
	        left: 603px;
	        top:78px;
        }
        .style1 {
	        font-size: 10px;
x	        color: #FFFFFF;
        }
        .style2 {font-size: 10px}
    </style>
</head>
 
 <body onUnload="TAB_GLOBAL_UNINITIALIZE(Array(Example));">
 
    </div>
<!-- InstanceBeginEditable name="content" -->
     <h2>Doing Research: Plagiarism Final</h2>
 <div class="heading">Please Enter Your Information</div>
<Fieldset>
<legend>Please provide the following. Items marked with * are required.</legend>
<form id="Form1" name="ctl00" method="post" action="default.aspx" runat="server">
                    <asp:label id="Message" runat="server" />
 
                        <asp:Panel id = "questionsPanel" runat ="server">
                        <asp:Label ID="Errors" runat="server" />
                        First Name:*<br />
                        <asp:TextBox ID="fname" runat="Server" /><br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="fname"
                            ErrorMessage="First Name" runat="server" Text="*First Name Required"></asp:RequiredFieldValidator>
                        <br />
                        Last Name:*<br />
                        <asp:TextBox ID="lname" runat="Server" /><br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="lname"
                            ErrorMessage="Last Name" runat="server" Text="*Last Name Required"></asp:RequiredFieldValidator>
                        <br />
				<asp:CustomValidator  ID="schoolName" runat="server" ClientValidationFunction="isValidName"
        ErrorMessage="If you are a guest, please enter your school name." Text="Custom error message test"></asp:CustomValidator>
<br />
				Status*:<br />
    
						
        <asp:RadioButtonList ID="status" RepeatDirection="Horizontal" runat="server">
				<asp:ListItem id="undergrad" Value="undergraduate"></asp:ListItem>
            <asp:ListItem id="grad" Value="graduate"></asp:ListItem>
            <asp:ListItem id="fs" Value="faculty/staff"></asp:ListItem><asp:ListItem id="guest" Value="guest user"></asp:ListItem>
        </asp:RadioButtonList>
    
<br /><br />
           <asp:TextBox runat="server" ID="school"></asp:TextBox>
             <br /><br />
                        <br />             Portal Username: (optional)<br />
                        <asp:TextBox ID="portal_id" runat="Server" />
                        <br />
                        <br />
												Course Name, Number and Section: (optional-ex. ENG-1023.15)<br />
                        <asp:TextBox ID="course_id" runat="Server" />
                        <br />
                        <br />
                        Your Email Address:* (a copy of your results will be sent to this address)<br />
                        <asp:TextBox ID="emailId" runat="Server" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="emailId"
                            ErrorMessage="Email" runat="Server" Text="*Email Address Is Required"></asp:RequiredFieldValidator><br />
                        <br />
                        Your Professor's Email Address: (optional-send your results to your professor)<br />
                        <asp:TextBox ID="emailId2" runat="Server" />
                        <br />
                        <p>
              
             
										  Please choose the best answer.</p>
                        <p>
                            1. Plagiarism is the act of:
                            <br />
                            <asp:RadioButtonList ID="q1" runat="server">
                                <asp:ListItem id="q1a" runat="server" Value="a. using someone else's work and citing it" />
                                <asp:ListItem id="q1b" runat="server" Value="b. using copyrighted materials for your paper" />
                                <asp:ListItem id="q1c" runat="server" Value="c. using someone else's work and not giving them credit" />
                                <asp:ListItem id="q1d" runat="server" Value="d. paraphrasing" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            2. Which of the following is copyrighted infringement?
                            <br />
                            <asp:RadioButtonList ID="q2" runat="server">
                                <asp:ListItem id="q2a" runat="server" Value="a. photocopying a college textbook" />
                                <asp:ListItem id="q2b" runat="server" Value="b. burning a CD that you did not own" />
                                <asp:ListItem id="q2c" runat="server" Value="c. downloading music or movies that you did not pay for" />
                                <asp:ListItem id="q2d" runat="server" Value="d. buying and submitting papers that you did not write" />
                                <asp:ListItem id="q2e" runat="server" Value="e. all of the above" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            3. Accidental plagiarism is:
                            <br />
                            <asp:RadioButtonList ID="q3" runat="server">
                                <asp:ListItem id="q3a" runat="server" Value="a. acceptable one time, as long as it was only an accident" />
                                <asp:ListItem id="q3b" runat="server" Value="b. okay if you paraphrased or changed the text a bit" />
                                <asp:ListItem id="q3c" runat="server" Value="c. always unacceptable" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            4. When citing my resources it is important that I:
                            <br />
                            <asp:RadioButtonList ID="q4" runat="server">
                                <asp:ListItem id="q4a" runat="server" Value="a. use a standard citation format assigned by your professor" />
                                <asp:ListItem id="q4b" runat="server" Value="b. include only the title and year" />
                                <asp:ListItem id="q4c" runat="server" Value="c. use footnotes, in-text citations, and italics for every citation" />
                                <asp:ListItem id="q4d" runat="server" Value="d. all of the above" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            5. RefWorks can help you:
                            <br />
                            <asp:RadioButtonList ID="q5" runat="server">
                                <asp:ListItem id="q5a" runat="server" Value="a. organize your research" />
                                <asp:ListItem id="q5b" runat="server" Value="b. only when you are using the MLA citation style" />
                                <asp:ListItem id="q5c" runat="server" Value="c. import references from many different data sources" />
                                <asp:ListItem id="q5d" runat="server" Value="d. create bibliographies using several citation styles" />
                                <asp:ListItem id="q5e" runat="server" Value="e. all of the above" />
                                <asp:ListItem id="q5f" runat="server" Value="f. a, c, d" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            6. Which of the following best describes plagiarism?
                            <br />
                            <asp:RadioButtonList ID="q6" runat="server">
                                <asp:ListItem id="q6a" runat="server" Value="a. A temporary fix until you have time to re-do the work" />
                                <asp:ListItem id="q6b" runat="server" Value="b. It's a serious offense and can result in severe penalties" />
                                <asp:ListItem id="q6c" runat="server" Value="c. It's easy to commit and not easy to detect" />
                                <asp:ListItem id="q6d" runat="server" Value="d. a and b" />
                            </asp:RadioButtonList>
                        </p>
                        <p>
                            7. When do you have to cite your resources?
                            <br />
                            <asp:RadioButtonList ID="q7" runat="server">
                                <asp:ListItem id="q7a" runat="server" Value="a. when what you are writing about is your own experience" />
                                <asp:ListItem id="q7b" runat="server" Value="b. when what you are writing about is common knowledge" />
                                <asp:ListItem id="q7c" runat="server" Value="c. when what you are writing about is someone else's idea" />
                            </asp:RadioButtonList>
                        </p>
                   
  <asp:Button ID="b1" Text="Submit" runat="server" />
                        <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="true"
                            HeaderText="You must enter a value in the following fields:" EnableClientScript="true"
                            runat="server" />
                     </asp:Panel>
                   </form>
 <!-- InstanceEndEditable --></td>
  </tr>
  <tr>
    <td id="footer"></td>
  </tr>
</table>
 
 
</body>
<!-- InstanceEnd -->
</html>

Open in new window

0
jianxin9Author Commented:
Thank you so much!  Wow, I really appreciate the help.  The only problem I am seeing is that when I select a row other than "3" for that question, the validator is still coming up if I try to submit the quiz.  I need it to only come up if row "3" is selected.  Is there a way to do that?
0
amxCommented:
Just update the javascript function with this:
 function isValidName(sender, args) {
        var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
        args.IsValid = true;
 
        if (rows[3].checked) {
            var txt = document.getElementById('<%=school.ClientID%>');
            args.IsValid = (txt.value.length > 0);
        }
    }

Open in new window

0
jianxin9Author Commented:
Thanks so much!  That makes the textbox required only when row 3 is selected.  :)  Okay, I think this is where it gets tricky.  When I try this code, the required function for status stops working.  Status needs to be required, but the textbox is only required when the user selects row 3 of status.  I have a required field validator for status, but now it seems to not be working.

				Status*:<br />
    
						
        <asp:RadioButtonList ID="status" RepeatDirection="Horizontal" runat="server">
				<asp:ListItem id="undergrad" Value="undergraduate"></asp:ListItem>
            <asp:ListItem id="grad" Value="graduate"></asp:ListItem>
            <asp:ListItem id="fs" Value="faculty/staff"></asp:ListItem><asp:ListItem id="guest" Value="guest user"></asp:ListItem>
        </asp:RadioButtonList>
				<asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="status"
                            ErrorMessage="Status" runat="server" Text="*Status Required"></asp:RequiredFieldValidator>
                        <br />
				
				
    
<asp:CustomValidator  ID="schoolName" runat="server" ClientValidationFunction="isValidName"
        ErrorMessage="School Name" Text="*If you are a guest user, please enter your school name"></asp:CustomValidator>
<br />
           <asp:TextBox runat="server" ID="school"></asp:TextBox>

Open in new window

0
amxCommented:
You can't use a requiredFieldValidator with a radioButtonList or a CheckboxList, so the only alternative is to use another custom validator which i have done below
<%@ Page Language="c#" Debug="true" %>
 
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Net" %>
 
<script runat="server" language="C#">
 
    private void Page_Load(object sender, EventArgs e)
    {
        status.Attributes.Add("onclick", "showHide();");
        Page.ClientScript.RegisterStartupScript(this.GetType(), "OnLoadHandler", "showHide();", true);
 
        if (Page.IsPostBack)
        {
            questionsPanel.Visible = false;
            Message.Visible = true;
            int correct = 0;
            if (q1.SelectedIndex == 2) correct++;
            if (q2.SelectedIndex == 4) correct++;
            if (q3.SelectedIndex == 2) correct++;
            if (q4.SelectedIndex == 0) correct++;
            if (q5.SelectedIndex == 5) correct++;
            if (q6.SelectedIndex == 1) correct++;
            if (q7.SelectedIndex == 2) correct++;
 
            LoadConn(correct);
        }
        else
        {
            questionsPanel.Visible = true;
            Message.Visible = false;
        }
    }
 
    private void LoadConn(int score)
    {
        int percent;
        percent = (score * 100) / 7;
 
        // Create the objects 
        OleDbConnection conn;
        OleDbCommand comm;
 
        // Instance the connection open it
        conn = new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; Data Source =" + Server.MapPath("") + ";User Id=; Jet OLEDB:Database Password=;");
        conn.Open();
 
        // Create the insert SQL 
        string sSQL = "";
        string qname = "plagiarism";
        sSQL = "Insert into posttest_table(fname,lname,username,coursenum,emailId,emailId2,status,school,qname,answered,score,q1,q2,q3,q4,q5,q6,q7) values('" + fname.Text + "','" + lname.Text + "','" + portal_id.Text + "','" + course_id.Text + "','" + emailId.Text + "','" + emailId2.Text + "','" + status.Text + "','" + school.Text + "','" + (qname) + "'," + score + "," + percent + "," + (q1.SelectedIndex + 1) + "," + (q2.SelectedIndex + 1) + "," + (q3.SelectedIndex + 1) + "," + (q4.SelectedIndex + 1) + "," + (q5.SelectedIndex + 1) + "," + (q6.SelectedIndex + 1) + "," + (q7.SelectedIndex + 1) + ");";
 
        //  Response.Write(sSQL + "<br />");
        //  Response.End();
        //  return;
 
        // Create a command object from the connection
        comm = conn.CreateCommand();
        comm.CommandText = sSQL;
        comm.CommandType = CommandType.Text;
 
        // Try the insert 
        try
        {
            comm.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            Response.Write("Error During DB Update: " + ex.ToString());
        }
 
 
 
        conn.Close();
        // Inserting data into the database end
 
        // Create the email body text
        /* String bodyInfo = fname.Text+" "+lname.Text+" has taken the exam.\n <br />"+fname.Text  +" has scored: "+percent+" out of 100 and gotten "+score+" out of 7 questions correct.\n<br /><br />"+fname.Text  +"'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option 3)<br /> You Answered:  Option "+(q1.SelectedIndex+1)+"\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option 5) <br />You Answered: Option "+(q2.SelectedIndex+1)+"\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option 3) <br />You Answered: Option "+(q3.SelectedIndex+1)+"\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option 1) <br />You Answered: Option "+(q4.SelectedIndex+1)+"\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option 6) <br />You Answered: Option "+(q5.SelectedIndex+1)+"\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option 2) <br />You Answered: Option "+(q6.SelectedIndex+1)+"\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option 3) <br /> You Answered: Option "+(q7.SelectedIndex+1);*/
 
        String bodyInfo = fname.Text + " " + lname.Text + " is a/an " + status.Text + ", and has taken the exam for the course " + course_id.Text + ".\n <br />" + fname.Text + " has scored: " + percent + " out of 100 and gotten " + score + " out of 7 questions correct.\n<br /><br />" + fname.Text + "'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option c)<br /> You Answered:  Option " + Convert.ToChar(q1.SelectedIndex + 97) + "\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option e) <br />You Answered: Option " + Convert.ToChar(q2.SelectedIndex + 97) + "\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option c) <br />You Answered: Option " + Convert.ToChar(q3.SelectedIndex + 97) + "\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option a) <br />You Answered: Option " + Convert.ToChar(q4.SelectedIndex + 97) + "\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option f) <br />You Answered: Option " + Convert.ToChar(q5.SelectedIndex + 97) + "\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option b) <br />You Answered: Option " + Convert.ToChar(q6.SelectedIndex + 97) + "\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option c) <br /> You Answered: Option " + Convert.ToChar(q7.SelectedIndex + 97);
 
 
        // Create SMTP client
        SmtpClient client = new SmtpClient("");
 
        // Create SMTP message
        MailMessage message = new MailMessage();
 
        // Set message properties 
        message.From = new MailAddress("");
        message.To.Add("");
        message.CC.Add(emailId.Text);
        if (!string.IsNullOrEmpty(emailId2.Text))
        {
            message.CC.Add(emailId2.Text);
        }
        message.Body = bodyInfo;
        message.Subject = "Doing Research: Plagiarism Quiz Results";
        message.IsBodyHtml = true;
 
        try
        {
 
            // Send EMail
            client.Send(message);
        }
        catch (Exception ex)
        {
            // Do Nothing  
        }
 
 
        // Send the user to the Results page
        Response.Redirect("results.aspx?fname=" + fname.Text + "&lname=" + lname.Text + "&score=" + percent + "&q1=" + (q1.SelectedIndex) + "&q2=" + (q2.SelectedIndex) + "&q3=" + (q3.SelectedIndex) + "&q4=" + (q4.SelectedIndex) + "&q5=" + (q5.SelectedIndex) + "&q6=" + (q6.SelectedIndex) + "&q7=" + (q7.SelectedIndex));
 
    }
 
 
 
</script>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Doing Research: Plagiarism Quiz</title>
    <meta name="Description" content="Texas Woman's University, with campuses in Denton, Dallas, and Houston, offers bachelor's, master's, and doctoral degrees to its students in the health sciences, the liberal arts, the fine arts, the sciences, and business." />
    <meta name="Keywords" content="texas woman's university, TWU, web guidelines, webspinners" />
    <link href="http://www.twu.edu/library/css/screen.css" rel="stylesheet" type="text/css"
        media="screen" />
    <link href="http://www.twu.edu/library/css/print.css" rel="stylesheet" type="text/css"
        media="print" />
    <link href="http://www.twu.edu/library/css/all2_tab.css" rel="stylesheet" type="text/css"
        media="screen" />
 
    <script type="text/javascript" src="http://www.twu.edu/library/js/TAB_Function_Lib.js"></script>
 
    <script type="text/javascript" language="javascript">
        function showHide() {
            var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
 
            if (rows[3].checked)
                document.getElementById('<%=school.ClientID%>').style.display = "block";
            else
                document.getElementById('<%= school.ClientID%>').style.display = "none";
        }
 
 
        function isValidName(sender, args) {
            var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
            args.IsValid = true;
 
            if (rows[3].checked) {
                var txt = document.getElementById('<%=school.ClientID%>');
                args.IsValid = (txt.value.length > 0);
            }
        }
 
        function ValidateStatus(source, arguments) {
            var rb = document.getElementById('<%= status.ClientID %>');
            alert(rb[0].checked);
//                if (rb[i].checked && (rb[i].value == 'A') || (rb[i].value == 'B') || (rb[i].value == 'C')) {
//                    alert("Uncheck a item...");
//                    return;
//                }
            
            alert("All perfect.");
        }
 
    </script>
 
    <style type="text/css">
        #Layer1
        {
            position: absolute;
            width: 186px;
            height: 18px;
            z-index: 3;
            left: 407px;
            top: 85px;
        }
        #Layer2
        {
            position: absolute;
            width: 421px;
            height: 30px;
            z-index: 4;
            left: 603px;
            top: 78px;
        }
        .style1
        {
            font-size: 10px;
            x: ccolor:#FFFFFF;}
        .style2
        {
            font-size: 10px;
        }
    </style>
</head>
<body onunload="TAB_GLOBAL_UNINITIALIZE(Array(Example));">
    </div>
    <!-- InstanceBeginEditable name="content" -->
    <h2>
        Doing Research: Plagiarism Final</h2>
    <div class="heading">
        Please Enter Your Information</div>
    <fieldset>
        <legend>Please provide the following. Items marked with * are required.</legend>
        <form id="Form1" name="ctl00" method="post" action="default.aspx" runat="server">
        <asp:Label ID="Message" runat="server" />
        <asp:Panel ID="questionsPanel" runat="server">
            <asp:Label ID="Errors" runat="server" />
            First Name:*<br />
            <asp:TextBox ID="fname" runat="Server" /><br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="fname"
                ErrorMessage="First Name" runat="server" Text="*First Name Required"></asp:RequiredFieldValidator>
            <br />
            Last Name:*<br />
            <asp:TextBox ID="lname" runat="Server" /><br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="lname"
                ErrorMessage="Last Name" runat="server" Text="*Last Name Required"></asp:RequiredFieldValidator>
            <br />
            <asp:CustomValidator ID="schoolName" runat="server" ClientValidationFunction="isValidName"
                ErrorMessage="If you are a guest, please enter your school name." Text="Custom error message test"></asp:CustomValidator>
            <br />
            Status*:<br />
            <asp:RadioButtonList ID="status" RepeatDirection="Horizontal" runat="server">
                <asp:ListItem id="undergrad" Value="undergraduate"></asp:ListItem>
                <asp:ListItem id="grad" Value="graduate"></asp:ListItem>
                <asp:ListItem id="fs" Value="faculty/staff"></asp:ListItem>
                <asp:ListItem id="guest" Value="guest user"></asp:ListItem>
            </asp:RadioButtonList>
             <asp:CustomValidator ID="CustomValidator2" runat="server" ClientValidationFunction="ValidateStatus"
                ErrorMessage="Status" Text="*Status Required"></asp:CustomValidator>
            
            <br />
            <asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="isValidName"
                ErrorMessage="School Name" Text="*If you are a guest user, please enter your school name"></asp:CustomValidator>
            <br />
            <asp:TextBox runat="server" ID="school"></asp:TextBox>
            <br />
            <br />
            <br />
            Portal Username: (optional)<br />
            <asp:TextBox ID="portal_id" runat="Server" />
            <br />
            <br />
            Course Name, Number and Section: (optional-ex. ENG-1023.15)<br />
            <asp:TextBox ID="course_id" runat="Server" />
            <br />
            <br />
            Your Email Address:* (a copy of your results will be sent to this address)<br />
            <asp:TextBox ID="emailId" runat="Server" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="emailId"
                ErrorMessage="Email" runat="Server" Text="*Email Address Is Required"></asp:RequiredFieldValidator><br />
            <br />
            Your Professor's Email Address: (optional-send your results to your professor)<br />
            <asp:TextBox ID="emailId2" runat="Server" />
            <br />
            <p>
                Please choose the best answer.</p>
            <p>
                1. Plagiarism is the act of:
                <br />
                <asp:RadioButtonList ID="q1" runat="server">
                    <asp:ListItem id="q1a" runat="server" Value="a. using someone else's work and citing it" />
                    <asp:ListItem id="q1b" runat="server" Value="b. using copyrighted materials for your paper" />
                    <asp:ListItem id="q1c" runat="server" Value="c. using someone else's work and not giving them credit" />
                    <asp:ListItem id="q1d" runat="server" Value="d. paraphrasing" />
                </asp:RadioButtonList>
            </p>
            <p>
                2. Which of the following is copyrighted infringement?
                <br />
                <asp:RadioButtonList ID="q2" runat="server">
                    <asp:ListItem id="q2a" runat="server" Value="a. photocopying a college textbook" />
                    <asp:ListItem id="q2b" runat="server" Value="b. burning a CD that you did not own" />
                    <asp:ListItem id="q2c" runat="server" Value="c. downloading music or movies that you did not pay for" />
                    <asp:ListItem id="q2d" runat="server" Value="d. buying and submitting papers that you did not write" />
                    <asp:ListItem id="q2e" runat="server" Value="e. all of the above" />
                </asp:RadioButtonList>
            </p>
            <p>
                3. Accidental plagiarism is:
                <br />
                <asp:RadioButtonList ID="q3" runat="server">
                    <asp:ListItem id="q3a" runat="server" Value="a. acceptable one time, as long as it was only an accident" />
                    <asp:ListItem id="q3b" runat="server" Value="b. okay if you paraphrased or changed the text a bit" />
                    <asp:ListItem id="q3c" runat="server" Value="c. always unacceptable" />
                </asp:RadioButtonList>
            </p>
            <p>
                4. When citing my resources it is important that I:
                <br />
                <asp:RadioButtonList ID="q4" runat="server">
                    <asp:ListItem id="q4a" runat="server" Value="a. use a standard citation format assigned by your professor" />
                    <asp:ListItem id="q4b" runat="server" Value="b. include only the title and year" />
                    <asp:ListItem id="q4c" runat="server" Value="c. use footnotes, in-text citations, and italics for every citation" />
                    <asp:ListItem id="q4d" runat="server" Value="d. all of the above" />
                </asp:RadioButtonList>
            </p>
            <p>
                5. RefWorks can help you:
                <br />
                <asp:RadioButtonList ID="q5" runat="server">
                    <asp:ListItem id="q5a" runat="server" Value="a. organize your research" />
                    <asp:ListItem id="q5b" runat="server" Value="b. only when you are using the MLA citation style" />
                    <asp:ListItem id="q5c" runat="server" Value="c. import references from many different data sources" />
                    <asp:ListItem id="q5d" runat="server" Value="d. create bibliographies using several citation styles" />
                    <asp:ListItem id="q5e" runat="server" Value="e. all of the above" />
                    <asp:ListItem id="q5f" runat="server" Value="f. a, c, d" />
                </asp:RadioButtonList>
            </p>
            <p>
                6. Which of the following best describes plagiarism?
                <br />
                <asp:RadioButtonList ID="q6" runat="server">
                    <asp:ListItem id="q6a" runat="server" Value="a. A temporary fix until you have time to re-do the work" />
                    <asp:ListItem id="q6b" runat="server" Value="b. It's a serious offense and can result in severe penalties" />
                    <asp:ListItem id="q6c" runat="server" Value="c. It's easy to commit and not easy to detect" />
                    <asp:ListItem id="q6d" runat="server" Value="d. a and b" />
                </asp:RadioButtonList>
            </p>
            <p>
                7. When do you have to cite your resources?
                <br />
                <asp:RadioButtonList ID="q7" runat="server">
                    <asp:ListItem id="q7a" runat="server" Value="a. when what you are writing about is your own experience" />
                    <asp:ListItem id="q7b" runat="server" Value="b. when what you are writing about is common knowledge" />
                    <asp:ListItem id="q7c" runat="server" Value="c. when what you are writing about is someone else's idea" />
                </asp:RadioButtonList>
            </p>
            <asp:Button ID="b1" Text="Submit" runat="server" />
            <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="true"
                HeaderText="You must enter a value in the following fields:" EnableClientScript="true"
                runat="server" />
        </asp:Panel>
        </form>
        <!-- InstanceEndEditable -->
        </td> </tr>
        <tr>
            <td id="footer">
            </td>
        </tr>
    </table>
</body>
<!-- InstanceEnd -->
</html>

Open in new window

0
jianxin9Author Commented:
Thank you again!  Really, I appreciate your help.  I didn't realize you couldn't do a required field validator w/a radio button list.  When I test the code, now when I submit the quiz, none of the validators show up at all, it just submits.  
0
amxCommented:
Oops. It turns out its only checkboxlist that you can't use with a required field validator.

I've removed the custom validator and put back the requiredFieldValidator.

It seems to be working as expected.
<%@ Page Language="c#" Debug="true" %>
 
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Net" %>
 
<script runat="server" language="C#">
 
    private void Page_Load(object sender, EventArgs e)
    {
        status.Attributes.Add("onclick", "showHide();");
        Page.ClientScript.RegisterStartupScript(this.GetType(), "OnLoadHandler", "showHide();", true);
 
        if (Page.IsPostBack)
        {
            questionsPanel.Visible = false;
            Message.Visible = true;
            int correct = 0;
            if (q1.SelectedIndex == 2) correct++;
            if (q2.SelectedIndex == 4) correct++;
            if (q3.SelectedIndex == 2) correct++;
            if (q4.SelectedIndex == 0) correct++;
            if (q5.SelectedIndex == 5) correct++;
            if (q6.SelectedIndex == 1) correct++;
            if (q7.SelectedIndex == 2) correct++;
 
            LoadConn(correct);
        }
        else
        {
            questionsPanel.Visible = true;
            Message.Visible = false;
        }
    }
 
    private void LoadConn(int score)
    {
        int percent;
        percent = (score * 100) / 7;
 
        // Create the objects 
        OleDbConnection conn;
        OleDbCommand comm;
 
        // Instance the connection open it
        conn = new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; Data Source =" + Server.MapPath("") + ";User Id=; Jet OLEDB:Database Password=;");
        conn.Open();
 
        // Create the insert SQL 
        string sSQL = "";
        string qname = "plagiarism";
        sSQL = "Insert into posttest_table(fname,lname,username,coursenum,emailId,emailId2,status,school,qname,answered,score,q1,q2,q3,q4,q5,q6,q7) values('" + fname.Text + "','" + lname.Text + "','" + portal_id.Text + "','" + course_id.Text + "','" + emailId.Text + "','" + emailId2.Text + "','" + status.Text + "','" + school.Text + "','" + (qname) + "'," + score + "," + percent + "," + (q1.SelectedIndex + 1) + "," + (q2.SelectedIndex + 1) + "," + (q3.SelectedIndex + 1) + "," + (q4.SelectedIndex + 1) + "," + (q5.SelectedIndex + 1) + "," + (q6.SelectedIndex + 1) + "," + (q7.SelectedIndex + 1) + ");";
 
        //  Response.Write(sSQL + "<br />");
        //  Response.End();
        //  return;
 
        // Create a command object from the connection
        comm = conn.CreateCommand();
        comm.CommandText = sSQL;
        comm.CommandType = CommandType.Text;
 
        // Try the insert 
        try
        {
            comm.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            Response.Write("Error During DB Update: " + ex.ToString());
        }
 
 
 
        conn.Close();
        // Inserting data into the database end
 
        // Create the email body text
        /* String bodyInfo = fname.Text+" "+lname.Text+" has taken the exam.\n <br />"+fname.Text  +" has scored: "+percent+" out of 100 and gotten "+score+" out of 7 questions correct.\n<br /><br />"+fname.Text  +"'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option 3)<br /> You Answered:  Option "+(q1.SelectedIndex+1)+"\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option 5) <br />You Answered: Option "+(q2.SelectedIndex+1)+"\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option 3) <br />You Answered: Option "+(q3.SelectedIndex+1)+"\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option 1) <br />You Answered: Option "+(q4.SelectedIndex+1)+"\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option 6) <br />You Answered: Option "+(q5.SelectedIndex+1)+"\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option 2) <br />You Answered: Option "+(q6.SelectedIndex+1)+"\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option 3) <br /> You Answered: Option "+(q7.SelectedIndex+1);*/
 
        String bodyInfo = fname.Text + " " + lname.Text + " is a/an " + status.Text + ", and has taken the exam for the course " + course_id.Text + ".\n <br />" + fname.Text + " has scored: " + percent + " out of 100 and gotten " + score + " out of 7 questions correct.\n<br /><br />" + fname.Text + "'s options were: \n<br /> Question 1. Plagiarism is the act of: <br />The correct answer is: using someone else's work and not giving them credit (Option c)<br /> You Answered:  Option " + Convert.ToChar(q1.SelectedIndex + 97) + "\n <br /><br />Question 2.  Which of the following is copyrighted infringement? <br />The correct answer is: all of the above (Option e) <br />You Answered: Option " + Convert.ToChar(q2.SelectedIndex + 97) + "\n <br /><br />Question 3.  Accidental plagiarism is: <br />The correct answer is: always unacceptable (Option c) <br />You Answered: Option " + Convert.ToChar(q3.SelectedIndex + 97) + "\n <br /><br />Question 4. When citing my resources it is important that I: <br />The correct answer is: use a standard citation format assigned by your professor (Option a) <br />You Answered: Option " + Convert.ToChar(q4.SelectedIndex + 97) + "\n <br /><br />Question 5. RefWorks can help you: <br />The correct answer is: a, c, d (Option f) <br />You Answered: Option " + Convert.ToChar(q5.SelectedIndex + 97) + "\n<br /><br /> Question 6. Which of the following best describes plagiarism?  <br />The correct answer is: It's a serious offense and can result in severe penalties (Option b) <br />You Answered: Option " + Convert.ToChar(q6.SelectedIndex + 97) + "\n<br /><br /> Question 7. When do you have to cite your resources? <br /> The correct answer is: when what you are writing about is someone else's idea (Option c) <br /> You Answered: Option " + Convert.ToChar(q7.SelectedIndex + 97);
 
 
        // Create SMTP client
        SmtpClient client = new SmtpClient("");
 
        // Create SMTP message
        MailMessage message = new MailMessage();
 
        // Set message properties 
        message.From = new MailAddress("");
        message.To.Add("");
        message.CC.Add(emailId.Text);
        if (!string.IsNullOrEmpty(emailId2.Text))
        {
            message.CC.Add(emailId2.Text);
        }
        message.Body = bodyInfo;
        message.Subject = "Doing Research: Plagiarism Quiz Results";
        message.IsBodyHtml = true;
 
        try
        {
 
            // Send EMail
            client.Send(message);
        }
        catch (Exception ex)
        {
            // Do Nothing  
        }
 
 
        // Send the user to the Results page
        Response.Redirect("results.aspx?fname=" + fname.Text + "&lname=" + lname.Text + "&score=" + percent + "&q1=" + (q1.SelectedIndex) + "&q2=" + (q2.SelectedIndex) + "&q3=" + (q3.SelectedIndex) + "&q4=" + (q4.SelectedIndex) + "&q5=" + (q5.SelectedIndex) + "&q6=" + (q6.SelectedIndex) + "&q7=" + (q7.SelectedIndex));
 
    }
 
 
 
</script>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Doing Research: Plagiarism Quiz</title>
    <meta name="Description" content="Texas Woman's University, with campuses in Denton, Dallas, and Houston, offers bachelor's, master's, and doctoral degrees to its students in the health sciences, the liberal arts, the fine arts, the sciences, and business." />
    <meta name="Keywords" content="texas woman's university, TWU, web guidelines, webspinners" />
    <link href="http://www.twu.edu/library/css/screen.css" rel="stylesheet" type="text/css"
        media="screen" />
    <link href="http://www.twu.edu/library/css/print.css" rel="stylesheet" type="text/css"
        media="print" />
    <link href="http://www.twu.edu/library/css/all2_tab.css" rel="stylesheet" type="text/css"
        media="screen" />
 
    <script type="text/javascript" src="http://www.twu.edu/library/js/TAB_Function_Lib.js"></script>
 
    <script type="text/javascript" language="javascript">
        function showHide() {
            var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
 
            if (rows[3].checked)
                document.getElementById('<%=school.ClientID%>').style.display = "block";
            else
                document.getElementById('<%= school.ClientID%>').style.display = "none";
        }
 
 
        function isValidName(sender, args) {
            var rows = document.getElementById('<%= status.ClientID %>').getElementsByTagName("input");
            args.IsValid = true;
 
            if (rows[3].checked) {
                var txt = document.getElementById('<%=school.ClientID%>');
                args.IsValid = (txt.value.length > 0);
            }
        }
 
    </script>
 
    <style type="text/css">
        #Layer1
        {
            position: absolute;
            width: 186px;
            height: 18px;
            z-index: 3;
            left: 407px;
            top: 85px;
        }
        #Layer2
        {
            position: absolute;
            width: 421px;
            height: 30px;
            z-index: 4;
            left: 603px;
            top: 78px;
        }
        .style1
        {
            font-size: 10px;
            x: ccolor:#FFFFFF;}
        .style2
        {
            font-size: 10px;
        }
    </style>
</head>
<body onunload="TAB_GLOBAL_UNINITIALIZE(Array(Example));">
    </div>
    <!-- InstanceBeginEditable name="content" -->
    <h2>
        Doing Research: Plagiarism Final</h2>
    <div class="heading">
        Please Enter Your Information</div>
    <fieldset>
        <legend>Please provide the following. Items marked with * are required.</legend>
        <form id="Form1" name="ctl00" method="post" action="default.aspx" runat="server">
        <asp:Label ID="Message" runat="server" />
        <asp:Panel ID="questionsPanel" runat="server">
            <asp:Label ID="Errors" runat="server" />
            First Name:*<br />
            <asp:TextBox ID="fname" runat="Server" /><br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="fname"
                ErrorMessage="First Name" runat="server" Text="*First Name Required"></asp:RequiredFieldValidator>
            <br />
            Last Name:*<br />
            <asp:TextBox ID="lname" runat="Server" /><br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="lname"
                ErrorMessage="Last Name" runat="server" Text="*Last Name Required"></asp:RequiredFieldValidator>
            <br />
            <asp:CustomValidator ID="schoolName" runat="server" ClientValidationFunction="isValidName"
                ErrorMessage="If you are a guest, please enter your school name." Text="Custom error message test"></asp:CustomValidator>
            <br />
            Status*:<br />
            <asp:RadioButtonList ID="status" RepeatDirection="Horizontal" runat="server">
                <asp:ListItem id="undergrad" Value="undergraduate"></asp:ListItem>
                <asp:ListItem id="grad" Value="graduate"></asp:ListItem>
                <asp:ListItem id="fs" Value="faculty/staff"></asp:ListItem>
                <asp:ListItem id="guest" Value="guest user"></asp:ListItem>
            </asp:RadioButtonList>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="status" ErrorMessage="Status" InitialValue="" Text="*Status Required" runat="server" ></asp:RequiredFieldValidator>
            
            <br />
            <asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="isValidName"
                ErrorMessage="School Name" Text="*If you are a guest user, please enter your school name"></asp:CustomValidator>
            <br />
            <asp:TextBox runat="server" ID="school"></asp:TextBox>
            <br />
            <br />
            <br />
            Portal Username: (optional)<br />
            <asp:TextBox ID="portal_id" runat="Server" />
            <br />
            <br />
            Course Name, Number and Section: (optional-ex. ENG-1023.15)<br />
            <asp:TextBox ID="course_id" runat="Server" />
            <br />
            <br />
            Your Email Address:* (a copy of your results will be sent to this address)<br />
            <asp:TextBox ID="emailId" runat="Server" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="emailId"
                ErrorMessage="Email" runat="Server" Text="*Email Address Is Required"></asp:RequiredFieldValidator><br />
            <br />
            Your Professor's Email Address: (optional-send your results to your professor)<br />
            <asp:TextBox ID="emailId2" runat="Server" />
            <br />
            <p>
                Please choose the best answer.</p>
            <p>
                1. Plagiarism is the act of:
                <br />
                <asp:RadioButtonList ID="q1" runat="server">
                    <asp:ListItem id="q1a" runat="server" Value="a. using someone else's work and citing it" />
                    <asp:ListItem id="q1b" runat="server" Value="b. using copyrighted materials for your paper" />
                    <asp:ListItem id="q1c" runat="server" Value="c. using someone else's work and not giving them credit" />
                    <asp:ListItem id="q1d" runat="server" Value="d. paraphrasing" />
                </asp:RadioButtonList>
            </p>
            <p>
                2. Which of the following is copyrighted infringement?
                <br />
                <asp:RadioButtonList ID="q2" runat="server">
                    <asp:ListItem id="q2a" runat="server" Value="a. photocopying a college textbook" />
                    <asp:ListItem id="q2b" runat="server" Value="b. burning a CD that you did not own" />
                    <asp:ListItem id="q2c" runat="server" Value="c. downloading music or movies that you did not pay for" />
                    <asp:ListItem id="q2d" runat="server" Value="d. buying and submitting papers that you did not write" />
                    <asp:ListItem id="q2e" runat="server" Value="e. all of the above" />
                </asp:RadioButtonList>
            </p>
            <p>
                3. Accidental plagiarism is:
                <br />
                <asp:RadioButtonList ID="q3" runat="server">
                    <asp:ListItem id="q3a" runat="server" Value="a. acceptable one time, as long as it was only an accident" />
                    <asp:ListItem id="q3b" runat="server" Value="b. okay if you paraphrased or changed the text a bit" />
                    <asp:ListItem id="q3c" runat="server" Value="c. always unacceptable" />
                </asp:RadioButtonList>
            </p>
            <p>
                4. When citing my resources it is important that I:
                <br />
                <asp:RadioButtonList ID="q4" runat="server">
                    <asp:ListItem id="q4a" runat="server" Value="a. use a standard citation format assigned by your professor" />
                    <asp:ListItem id="q4b" runat="server" Value="b. include only the title and year" />
                    <asp:ListItem id="q4c" runat="server" Value="c. use footnotes, in-text citations, and italics for every citation" />
                    <asp:ListItem id="q4d" runat="server" Value="d. all of the above" />
                </asp:RadioButtonList>
            </p>
            <p>
                5. RefWorks can help you:
                <br />
                <asp:RadioButtonList ID="q5" runat="server">
                    <asp:ListItem id="q5a" runat="server" Value="a. organize your research" />
                    <asp:ListItem id="q5b" runat="server" Value="b. only when you are using the MLA citation style" />
                    <asp:ListItem id="q5c" runat="server" Value="c. import references from many different data sources" />
                    <asp:ListItem id="q5d" runat="server" Value="d. create bibliographies using several citation styles" />
                    <asp:ListItem id="q5e" runat="server" Value="e. all of the above" />
                    <asp:ListItem id="q5f" runat="server" Value="f. a, c, d" />
                </asp:RadioButtonList>
            </p>
            <p>
                6. Which of the following best describes plagiarism?
                <br />
                <asp:RadioButtonList ID="q6" runat="server">
                    <asp:ListItem id="q6a" runat="server" Value="a. A temporary fix until you have time to re-do the work" />
                    <asp:ListItem id="q6b" runat="server" Value="b. It's a serious offense and can result in severe penalties" />
                    <asp:ListItem id="q6c" runat="server" Value="c. It's easy to commit and not easy to detect" />
                    <asp:ListItem id="q6d" runat="server" Value="d. a and b" />
                </asp:RadioButtonList>
            </p>
            <p>
                7. When do you have to cite your resources?
                <br />
                <asp:RadioButtonList ID="q7" runat="server">
                    <asp:ListItem id="q7a" runat="server" Value="a. when what you are writing about is your own experience" />
                    <asp:ListItem id="q7b" runat="server" Value="b. when what you are writing about is common knowledge" />
                    <asp:ListItem id="q7c" runat="server" Value="c. when what you are writing about is someone else's idea" />
                </asp:RadioButtonList>
            </p>
            <asp:Button ID="b1" Text="Submit" runat="server" />
            <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="true"
                HeaderText="You must enter a value in the following fields:" EnableClientScript="true"
                runat="server" />
        </asp:Panel>
        </form>
        <!-- InstanceEndEditable -->
        </td> </tr>
        <tr>
            <td id="footer">
            </td>
        </tr>
    </table>
</body>
<!-- InstanceEnd -->
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jianxin9Author Commented:
That did it! THANK YOU!!!!
0
jianxin9Author Commented:
You rock! Thanks for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.