/* * To change this template, choose Tools | Templates * and open the template in the editor. */ var annexA_banknm; var annexA_branch; var annexA_account_no; var annexA_bank_addr; var annexA_held_mode; var annexB_parmanent_addr; var annexB_present_addr; var action; var xmlHttp; var deleteID; var EMP_PREFIX = "emp-"; function resetVal() { document.getElementById("annex_A_dob").value=""; } function addAnnexB() { var chkflg=checkAnnexBdata(); if(chkflg) { var str=document.getElementById("annexB_email").value; var chkemail=echeck(str); if(chkemail==true) { document.fannexB.submit(); } else { return false; } } else return false; // addAnnextureB(); //window.navigate("registration.jsp"); } function checkAnnexBdata() { var annexB_fname=document.getElementById("annexB_fname").value; var annexB_lname=document.getElementById("annexB_lastnm").value; var annexB_email=document.getElementById("annexB_email").value; var anexB_income_tax_pan_no=document.getElementById("anexB_income_tax_pan_no").value; var pan_check_value=document.getElementById("panCheck").value; // alert(pan_check_value); //---------------------Added for making the Address fields Mandatory-------------------------------------// var annexB_present_addr1=document.getElementById("annexB_present_addr1").value; var annexB_present_addr2=document.getElementById("annexB_present_addr2").value; var annexB_present_addr3=document.getElementById("annexB_present_addr3").value; var annexB_parmanent_addr1=document.getElementById("annexB_parmanent_addr1").value; var annexB_parmanent_addr2=document.getElementById("annexB_parmanent_addr2").value; var annexB_parmanent_addr3=document.getElementById("annexB_parmanent_addr3").value; //---------------------Added for making the Address fields Mandatory-------------------------------------// if(annexB_fname=="" || annexB_fname==null) { alert("First name can not be blank..."); return false; } if(annexB_lname=="" || annexB_lname==null) { alert("Last name can not be blank"); return false; } //---------------------Added for making the Address fields Mandatory-------------------------------------// if((annexB_present_addr1=="" || annexB_present_addr1==null) && (annexB_present_addr2=="" || annexB_present_addr2==null) && (annexB_present_addr3=="" || annexB_present_addr3==null)) { alert("Present Address can not be blank..."); document.getElementById("annexB_present_addr1").focus(); return false; } if((annexB_parmanent_addr1=="" || annexB_parmanent_addr1==null) && (annexB_parmanent_addr2=="" || annexB_parmanent_addr2==null) && (annexB_parmanent_addr3=="" || annexB_parmanent_addr3==null)) { alert("Permanent Address can not be blank..."); document.getElementById("annexB_parmanent_addr1").focus(); return false; } //---------------------Added for making the Address fields Mandatory-------------------------------------// if(annexB_email=="" || annexB_email==null) { alert("Email can not be blank...") return false; } if(pan_check_value=="off" && (anexB_income_tax_pan_no=="" || anexB_income_tax_pan_no==null)) { alert("Pan number can not be blank.Otherwise click on the check box if Director is Non-residential Indian."); return false; } else { var flg=(pan_check_value=="off" ? validatePan(anexB_income_tax_pan_no) : true); if(flg==false) { return false; } } return true; } function validatePan(pan_tan) { var pan_tan,len; //pan_tan=document.getElementById("anexB_income_tax_pan_no").value; len=pan_tan.length; if (typeof pan_tan == "string") pan_tan = pan_tan.toUpperCase(); var flg='N'; for( var i=0;i 1) { document.getElementById("anexB_tenpos_yr").value= document.getElementById("anexB_tenpos_yr").value.substring(0, 1); return; } if (anexB_unitpos_yr1.length > 1) { document.getElementById("anexB_unitpos_yr").value= document.getElementById("anexB_unitpos_yr").value.substring(0, 1); return; } if (anexB_tenpos_mon1.length > 1) { document.getElementById("anexB_tenpos_mon").value= document.getElementById("anexB_tenpos_mon").value.substring(0, 1); return; } if (anexB_tenpos_mon1.length > 1) { document.getElementById("anexB_tenpos_mon").value= document.getElementById("anexB_tenpos_mon").value.substring(0, 1); return; } if (anexB_utitpos_mon1.length > 1) { document.getElementById("anexB_utitpos_mon").value= document.getElementById("anexB_utitpos_mon").value.substring(0, 1); return; } if ((anexB_tenpos_mon1==1 && (anexB_utitpos_mon1!=null && anexB_utitpos_mon1!="")) && (anexB_utitpos_mon1=='3' || anexB_utitpos_mon1=='4'|| anexB_utitpos_mon1=='5'|| anexB_utitpos_mon1=='6'|| anexB_utitpos_mon1=='7'|| anexB_utitpos_mon1=='8'|| anexB_utitpos_mon1=='9'|| anexB_utitpos_mon1=='' )) { alert("invalid month"); document.getElementById("anexB_utitpos_mon").value= ""; return; } if(anexB_tenpos_mon1=='2'||anexB_tenpos_mon1=='3'||anexB_tenpos_mon1=='4'||anexB_tenpos_mon1=='5'||anexB_tenpos_mon1=='6'||anexB_tenpos_mon1=='7'||anexB_tenpos_mon1=='8'||anexB_tenpos_mon1=='9') { alert("invalid month"); document.getElementById("anexB_tenpos_mon").value= ""; return; } } ////////////////store annextureA data to the bean///////////////////////// function handleAnnexAaddState() { alert("HandleAnnex"); if(xmlHttp.readyState == 4) { alert("HandleAnnex1"); if(xmlHttp.status !=200) { alert("Error while adding annextueA information"); } else { updateAnnexAVisibility(); } } } function updateAnnexAVisibility() { document.getElementById("annexA").style.display = ""; } function createXMLHttpRequest() { //alert("httprequest"); if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } function handleDeleteStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { if(action=="AnnxrAdelete"){ // alert("delete AnnxrList=="+deleteID); var table = document.getElementById('AnnxrAList'); var delrowid=document.getElementById(deleteID); table.removeChild(delrowid); var table1 = document.getElementById('AnnxrAList2'); var delrowid1=document.getElementById("B"+deleteID); // alert(delrowid1); table1.removeChild(delrowid1); }else if(action=="AnnxrBdelete"){ var table3 = document.getElementById('AnnxrAList'); var delrowid3=document.getElementById(deleteID); table3.removeChild(delrowid3); var table12 = document.getElementById('AnnxrAList2'); var delrowid12=document.getElementById("B"+deleteID); // alert(delrowid1); table12.removeChild(delrowid12); } } } } function handleAnnexBaddState() { if(xmlHttp.readyState == 4) { alert(xmlHttp.status); if(xmlHttp.status !=200) { alert("Error while adding annextueB information"); } else { updateAnnexBVisibility(); } } } ////////////////////////////Add annextureB address///////////////////////////////////// function deleteAnnexBAddrFromList() { var status = xmlHttp.responseXML.getElementsByTagName("status").item(0).firstChild.nodeValue; status = parseInt(status); if(status != 1) { return; } var rowToDelete = document.getElementById(EMP_PREFIX + deleteID); var annexBAddrList = document.getElementById("annexBAddrList"); annexBAddrList.removeChild(rowToDelete); updateAnnexBAddrListVisibility(); } function checkLenAnnexA(arg) { var anexA_telephone_no=document.getElementById("anexA_telephone_no").value; var annexA_mob_no=document.getElementById("annexA_mob_no").value; var annexA_fax_no=document.getElementById("annexA_fax_no").value; if(arg=='anexA_telephone_no' && anexA_telephone_no!="") { if(anexA_telephone_no.length!=11) { alert("Telephone No.(with STD) will be of 11 digit"); //document.getElementById("annexB_mob_no").value=""; document.getElementById("anexA_telephone_no").focus(); return; } } else if(arg=='annexA_mob_no' && annexA_mob_no!="") { if(annexA_mob_no.length!=10) { alert("Mobile No. will be of 10 digit"); //document.getElementById("annexB_mob_no").value=""; document.getElementById("annexA_mob_no").focus(); return; } } } function checkLenAnnexB(arg) { var anexB_telephone_no=document.getElementById("anexB_telephone_no").value; var annexB_mob_no=document.getElementById("annexB_mob_no").value; if(arg=='anexB_telephone_no' && anexB_telephone_no.length>0) { if(anexB_telephone_no.length!=11) { alert("Telephone No.(with STD) will be of 11 digit"); //document.getElementById("annexB_mob_no").value=""; document.getElementById("anexB_telephone_no").focus(); return; } } else if(arg=='annexB_mob_no' && annexB_mob_no.length>0) { if(annexB_mob_no.length!=10) { alert("Mobile No. will be of 10 digit"); //document.getElementById("annexB_mob_no").value=""; document.getElementById("annexB_mob_no").focus(); return; } } // else if(arg=='annexA_fax_no' && annexA_fax_no!="") // { // // if(annexA_fax_no.length!=4) // { // alert("Fax No. will be of 4 digit"); // //document.getElementById("annexB_mob_no").value=""; // document.getElementById("annexA_fax_no").focus(); // return; // } // } } function printdata(){ window.navigate("printdata.jsp"); }