troubleshooting Question

asp.net, jquery, validation, radiobutton

Avatar of Webboy2008
Webboy2008 asked on
ASP.NETAJAXjQuery
3 Comments1 Solution484 ViewsLast Modified:
I have the following codes working fine but want to do one more validation

If the rdoadministrator is selected yes (value = 1), I would like to make sure the user enter all of the information (like city, state, zip, address, and etc.).
How can I modify the current jquery script?

Thanks

<script type="text/javascript">

    // a custom onComplete handler to prevent form submits for the demo
    function myOnComplete() {
        //alert("The form validates! (normally, it would submit the form here).");
        //return false;
    }
    $(document).ready(function() {
    $("#frmquoteadditional").RSV({
            onCompleteHandler: myOnComplete,
            displayType: "display-html",
            errorFieldClass: "errorFieldDemo2",
            rules: [
            "required,rdoadministrator, Is Plan serviced by an Independent Administrator?",
                  "required,rdoadministrator,Please enter Administrator Name.",
                  "required,rdocpa,Is Plan audited annually by the CPA?",
                  "required,txttrustee1Ssn1,Please enter primary Trustee SSN.",
                  "required,txttrustee1Ssn2,Please enter primary Trustee SSN.",
                  "required,txttrustee1Ssn3,Please enter primary Trustee SSN.",
                  "required,txttrusteeaddr1,Please enter primary Trustee Address.",
                  "required,txttrusteecity1,Please enter primary Trustee City.",
                  "required,txttrusteestate1,Please enter primary Trustee State.",
                  "required,txttrusteezip1,Please enter primary Trustee Zip code."
            ]
        });
       
    });      </script>
<%
 p=p & "<table cellpadding=""0"" cellspacing=""0""  width=""100%"">"
    p=p & "<tr><td width=""330""><b>Is the Plan serviced by an Independent Administrator?</b></td>"
    p=p & "<td>&nbsp;"
    p=p & "<input type=""radio"" name=""rdoadministrator"" value=""1""  />Yes"
    p=p & "&nbsp;"
    p=p & "<input type=""radio"" name=""rdoadministrator"" value=""0"" />No"
    p=p & "</td></tr></table>"
 p=p & "<table>"
          p=p & "<Tr valign=""top""><td width=""330""><STRONG>Name of Administrator:</STRONG></td>"
          P=P & "<td><input size=""40"" class=""textboxdata"" name=""txtadminname"" value=""" & Request.Form("txtadminname") & """>"
          P=P & "</td></tr>"
          p=p & "<Tr valign=""top""><Td width=""330""><STRONG>Address:</STRONG></td><Td><input size=""40"" class=""textboxdata"" type=""text"" name=""txtaddress1"" value=""" & Request.Form("txtaddress1") & """></td></tr>"
          p=p & "<tr valign=""top""><Td width=""330""><STRONG>City/State/Zip:</STRONG></td>"
          p=p & "<td>"
          p=p & "<input size=""19"" class=""textboxdata"" type=""text"" name=""txtcity1"" value=""" & Request.Form("txtcity1")   & """>&nbsp;"
          p=p & "<input size=""2""  class=""textboxdata"" maxlength=""2"" type=""text"" name=""txtstate1"" value=" & Request.Form("txtstate1") & ">&nbsp;"
          p=p & "<input onkeyup=""this.value=this.value.replace(/\D/gi,'')"" size=""5""  class=""textboxdata"" maxlength=""5"" type=""text"" name=""txtzip1""   value=" & Request.Form("txtzip1")   & ">"
          p=p & "</td>"
          p=p & "</tr>"          
          p=p & "</table>"      
%>
ASKER CERTIFIED SOLUTION
Jon Norman
Information Systems Manager
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros