var ajx; var ajxbool; try{ ajx=new XMLHttpRequest(); ajxbool=true; } catch(e){ ajx=new ActiveXObject("Microsoft.XMLHTTP"); ajxbool=true; } function IsNumeric(strString) // check for valid numeric strings { var strValidChars = "0123456789.-"; var strChar; var blnResult = true; if (strString.length == 0) return false; for (i = 0; i < strString.length && blnResult == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { blnResult = false; } } return blnResult; } function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } function sortSelect(selElem) { var tmpAry = new Array(); for (var i=0;i 0) { selElem.options[0] = null; } for (var i=0;i { const option = document.createElement("option"); option.value = dept.value; option.innerHTML = dept.label; deptSelect.appendChild(option); }); sortSelect(deptSelect); } } function payfee(){ var fname=document.getElementById('fname').value; var phone=document.getElementById('phone').value; var email=document.getElementById('email').value; var matno=document.getElementById('matno').value; var sch=document.getElementById('sch').value; var dept=document.getElementById('dept').value; var prog=document.getElementById('prog').value; var lga = document.getElementById('lga').value; if(matno.length<3){ alert("Please enter your matric number/registration no."); exit; } if(fname.length<3){ alert("Please enter your full name."); exit; } var em=validateEmail(email); if(em==false){ alert("Invalid email address."); exit; } if(!IsNumeric(phone)){ alert('Unrecognized Phone Number.'); exit; } if((phone.substring(6,10)=="00000") || (phone.length<11)){ alert ("Invalid phone number."); exit; } if(sch=="none"){ alert("Choose your school!"); exit; } if(dept=="none"){ alert("Choose your department!"); exit; } if(lga=="none"){ alert("Choose your state and LGA!"); exit; } if(prog=="none"){ alert("Choose your programme!"); exit; } var conf=confirm("Are you sure you want to continue with the payment?"); if(conf==0){ exit; } document.dataform.submit(); } function payhostelfee(){ var fname=document.getElementById('fname').value; var phone=document.getElementById('phone').value; var email=document.getElementById('email').value; var matno=document.getElementById('matno').value; var sch=document.getElementById('sch').value; var dept=document.getElementById('dept').value; if(matno.length<3){ alert("Please enter your matric number/registration no."); exit; } if(fname.length<3){ alert("Please enter your full name."); exit; } var em=validateEmail(email); if(em==false){ alert("Invalid email address."); exit; } if(!IsNumeric(phone)){ alert('Unrecognized Phone Number.'); exit; } if((phone.substring(6,10)=="00000") || (phone.length<11)){ alert ("Invalid phone number."); exit; } if(sch=="none"){ alert("Choose your school!"); exit; } if(dept=="none"){ alert("Choose your department!"); exit; } if(document.getElementById('ch1').checked==false && document.getElementById('ch2').checked==false && document.getElementById('ch3').checked==false ){ alert('Select hostel.'); exit; } var conf=confirm("Are you sure you want to continue with the payment?"); if(conf==0){ exit; } document.dataform.submit(); } function verifyDetails(){ var fname=document.getElementById('fname').value; var phone=document.getElementById('phone').value; var email=document.getElementById('email').value; var matno=document.getElementById('matno').value; var sch=document.getElementById('sch').value; var dept=document.getElementById('dept').value; var prog=document.getElementById('prog').value; var password1 = document.getElementById('password').value; var password2 = document.getElementById('password1').value; var dday = document.getElementById('day').value; var dmonth = document.getElementById('month').value; var dyear = document.getElementById('year').value; //alert(dday); if(matno.length<3){ alert("Invalid matriculation /registration number"); exit; } if(fname.length<3){ alert("Please enter your full name."); exit; } var em=validateEmail(email); if(em==false){ alert("Invalid email address."); exit; } if(!IsNumeric(phone)){ alert('Unrecognized Phone Number.'); exit; } if((phone.substring(6,10)=="00000") || (phone.length<11)){ alert ("Invalid phone number."); exit; } if(sch=="none"){ alert("Choose your school!"); exit; } if(dept=="none"){ alert("Choose your department!"); exit; } if(dday=="0" || dmonth=="0" || dyear=="0") { alert("Enter your date of birth please") exit; } if(prog=="none"){ alert("Choose your programme!"); exit; } if(password1!=password2){ alert("Password mismatch!"); document.getElementById('password1').value='' exit; } var conf=confirm("Proceed with Registration?"); if(conf==0){ exit; } document.dataform.submit(); }