<script type="text/javascript"> $(function callme() { $('#CheckBox1').click(function () { if ($(this).is(':checked')) { uservalid(); } }); }); function uservalid() { var name, mobile, mail, query; name = document.getElementById("ContentPlaceHolder1_text10").value; mobile = document.getElementById("ContentPlaceHolder1_text11").value; mail = document.getElementById("ContentPlaceHolder1_text12").value; query = document.getElementById("ContentPlaceHolder1_text13").value; emailExp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([com\co\.\in])+$/; if (name == "" && mobile == "" && mail == "" && query == "") { alert("Enter All Fields Mendatory!!"); return false; } else if (name == "") { alert("Enter Name"); document.getElementById("ContentPlaceHolder1_Text10").setAttribute("style", "border:solid 1px red;background-color:#E2D3DD"); } else if (mobile == "") { alert("Enter Mobile"); document.getElementById("ContentPlaceHolder1_Text11").setAttribute("style", "border:solid 1px red;background-color:#E2D3DD"); } else if (mail == "") { alert("Enter Mail "); document.getElementById("ContentPlaceHolder1_Text12").setAttribute("style", "border:solid 1px red;background-color:#E2D3DD"); } else if (mail != '') { if (!mail.match(emailExp)) { alert("Invalid Email Id"); return false; } return true; } else if (query == "") { alert("Enter your Query"); document.getElementById("ContentPlaceHolder1_Text13").setAttribute("style", "border:solid 1px red;background-color:#E2D3DD"); } } </script>
if($("#CheckBox1").is(':checked'))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)