<script id="script2" type="text/javascript">
function Propsectvalidate() {
//Start---Validation for checkbox list
if (document.getElementById("<%=chklProductType.ClientID%>") != null) {
var isChecked = 0;
var list = document.getElementById('<%= chklProductType.ClientID %>');
var chkList = list.getElementsByTagName("input");
for (var i = 0; i < chkList.length; i++) {
if (chkList[i].checked) {
isChecked = 1;
}
}
if(isChecked==0)
{
alert("Please Check Product Type");
document.getElementById("<%=chklProductType.ClientID%>").focus();
return false;
}
}
//End--Validation for checkbox list---
if (document.getElementById("<%=txtNameofBusiness.ClientID%>").value == "") {
alert("Prospect Name can not be blank");
document.getElementById("<%=txtNameofBusiness.ClientID%>").focus();
return false;
}
//Start---Validation for checkbox list
if (document.getElementById("<%=chklProductType.ClientID%>") != null) {
var isChecked = 0;
var list = document.getElementById('<%= chklProductType.ClientID %>');
var chkList = list.getElementsByTagName("input");
for (var i = 0; i < chkList.length; i++) {
if (chkList[i].checked) {
isChecked = 1;
}
}
if(isChecked==0)
{
alert("Please Check Product Type");
document.getElementById("<%=chklProductType.ClientID%>").focus();
return false;
}
}
//End--Validation for checkbox list---
if (document.getElementById("<%=txtNameofBusiness.ClientID%>").value == "") {
alert("Prospect Name can not be blank");
document.getElementById("<%=txtNameofBusiness.ClientID%>").focus();
return false;
}
//Start---Validation for dropdown list
if (document.getElementById("<%=ddlState.ClientID %>").value == 0) {
alert("Please select the State");
document.getElementById("<%=ddlState.ClientID %>").focus();
return false;
}
alert("Please select the State");
document.getElementById("<%=ddlState.ClientID %>").focus();
return false;
}
//End----Validation for dropdown list
}
</script>
}
</script>
<asp:ImageButton ID="btnSubmit" runat="server" ImageUrl="~/images/Buttons/save.png" OnClick="btnSubmit_Click" CausesValidation="False" Visible="false" OnClientClick=" return Propsectvalidate()" />
No comments:
Post a Comment