<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="return validationfrm();" />
-------------------------------------------<script type="text/javascript">function validationfrm() {
var rval = true;
var objfoucs;
var varFName = document.getElementById('<%=txtFName.ClientID %>').value;
var varLName = document.getElementById('<%=txtLName.ClientID %>').value;
var varEmpID = document.getElementById('<%=txtEmpID.ClientID %>').value;
var varEmail = document.getElementById('<%=txtEmail.ClientID %>').value;
var varddjoindate = document.getElementById('<%=ddjoindate.Controls[0].ClientID %>').value;
var vardob = document.getElementById('<%=dddob.Controls[0].ClientID %>').value;
var varppmanager = document.getElementById('<%=ppmanager.ClientID %>').value;
if (varFName == null || varFName == "") {alert(
"First name must be filled out");
if (objfoucs == null)objfoucs = document.getElementById(
'<%=txtFName.ClientID %>');objfoucs.focus();
rval =
false;}
else if (varLName == null || varLName == "") {alert(
"Last name must be filled out");
if (objfoucs == null)objfoucs = document.getElementById(
'<%=txtLName.ClientID %>');objfoucs.focus();
rval =
false;}
else if (varEmpID == null || varEmpID == "") {alert(
"Employee ID must be filled out");
if (objfoucs == null)objfoucs = document.getElementById(
'<%=txtEmpID.ClientID %>');objfoucs.focus();
rval =
false;}
else if (varEmail == null || varEmail == "") {alert(
"Email must be filled out");
if (objfoucs == null)objfoucs = document.getElementById(
'<%=txtEmail.ClientID %>');objfoucs.focus();
rval =
false;}
else if (varddjoindate == "") {alert(
"Date Of Join must be filled out");
if (objfoucs == null)objfoucs = document.getElementById(
'<%=ddjoindate.Controls[0].ClientID %>');objfoucs.focus();
rval =
false;}
else if (vardob == "") {alert(
"Date Of Birth must be filled out");
if (objfoucs == null)objfoucs = document.getElementById(
'<%=dddob.Controls[0].ClientID %>');objfoucs.focus();
rval =
false;}
else if (varppmanager == "") {alert(
"Please Pick Your Manager");
if (objfoucs == null)objfoucs = document.getElementById(
'<%=ppmanager.ClientID %>');objfoucs.focus();
rval =
false;}
//alert(rval);return rval;
}
</script><script language="javascript" type="text/javascript">function fnDelete(obj) {
if (confirm("Are you sure you want to delete?")) {
return true;}
elsereturn false;}
</script>
No comments:
Post a Comment