Вы находитесь на странице: 1из 6

EDUCATION: <script type="text/javascript" language="javascript" > function button_actions(){ var var var var var var a b c d e f = document.forms["f2"]["t1"].value; =parseFloat(document.forms["f2"]["t3"].

value); = document.forms["f2"]["t4"].value; = parseFloat(document.forms["f2"]["t6"].value); = document.forms["f2"]["t7"].value; = parseFloat(document.forms["f2"]["t10"].value);

if (isNaN(document.f2.t1.value)){ alert('Enter year of passing of 10th std. !!'); document.f2.t1.focus(); return false; } if((a<1950) || (a>2012)){ alert("Passing year of 10th std. should be between 1950-current year"); document.f2.t1.focus(); return false; } if (!document.f2.t2.value){ alert('Enter board of 10th std. !!'); document.f2.t2.focus(); return false; } if (isNaN(b)||b<10 || b>100){ alert('Enter corect percentage of 10th std.!!'); document.f2.t3.focus(); return false; } if (isNaN(document.f2.t4.value)){ alert('Enter passing year of 12th std. !!'); document.f2.t4.focus(); return false; } if((c<1950) || (c>2012)){ alert("Passing year of 12 std. should be between 1950-current ye ar"); document.f2.t4.focus(); return false; } if (!document.f2.t5.value){ alert('Enter board of 12th std. !!'); document.f2.t5.focus(); return false; } if(isNaN(d)||d<10 || d>100){ alert('Enter corect percentage of 12th std. !!'); document.f2.t6.focus(); return false; } if (isNaN(document.f2.t7.value)){ alert('Enter pasing year of graduation!!');

document.f2.t7.focus(); return false; } if((e<1950) || (e>2012)){ alert("Passing year of graduation should be between 1950-current year"); document.f2.t7.focus(); return false; } if(document.f2.d1.selectedIndex==0){ alert("Please select your course of graduation..."); document.f2.d1.focus(); return false; } if (!document.f2.t8.value){ alert('Enter your stream of graduation !!'); document.f2.t8.focus(); return false; } if (!document.f2.t9.value){ alert('Enter university name of your graduation. !!'); document.f2.t9.focus(); return false; } if(isNaN(f)||f<0 || f>100){ alert('Enter correct percentage of your graduation. !!'); document.f2.t10.focus(); return false; } alert('Congrats,you are done !!!!!!!!!!'); } </script>

PERSONAL:

<script type="text/javascript" LANGUAGE="javascript" > function button_actions( ){ var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9] {2,4})+$/; if (!document.Form1.t1.value){ alert('You can not leave the field(s) blank!!'); document.Form1.t1.focus(); return false; } if(!regex.test(document.Form1.t1.value)) { alert("Invalid email address format"); document.Form1.t1.focus(); return false;

} if (!document.Form1.t2.value){ alert('You can not leave the field(s) blank!!'); document.Form1.t2.focus(); return false; } if (document.Form1.t2.value.length<6){ alert('Use atleast 6 characters for password!!'); document.Form1.t2.focus(); return false; } if (!document.Form1.t3.value){ alert('You can not leave the field(s) blank!!'); document.Form1.t3.focus(); return false; } if (document.Form1.t2.value != document.Form1.t3.value){ alert('Should be the same with password!!'); document.Form1.t3.focus(); return false; } if (!document.Form1.t4.value){ alert('You can not leave the field(s) blank!!'); document.Form1.t4.focus(); return false; } if (!document.Form1.t5.value){ alert('You can not leave the field(s) blank!!'); document.Form1.t5.focus(); return false; } var input = document.getElementById("t6"); var validformat = /^\d{2}\/\d{2}\/\d{4}$/ //Basic check for format v alidity if (!validformat.test(document.Form1.t6.value)){ alert("Please Enter a Valid Date format.") document.Form1.t6.focus(); return false; } else { //Here we will do The Detailed check for valid date ranges var monthfield = document.Form1.t6.value.split("/")[1] var dayfield = document.Form1.t6.value.split("/")[0] var yearfield = document.Form1.t6.value.split("/")[2] var dayobj = new Date(yearfield, monthfield - 1, dayfield) if ((dayobj.getDate() != dayfield) || (dayobj.getMonth() + 1 != monthfield) || (dayobj.getFullYear() != yearfield)) alert("Invalid Value For Day, Month, or Year range detected. ") document.Form1.t6.focus(); }

if(document.Form1.d1.selectedIndex==0) { alert("Please select an Item."); document.Form1.d1.focus();

return false; } if(document.Form1.d2.selectedIndex==0) { alert("Please select an Item."); document.Form1.d2.focus(); return false; }

if(document.Form1.t10.value.length!=6) { alert("Please enter zip code of 6 digit."); document.Form1.t10.focus(); return false; } else if(isNaN(document.Form1.t10.value)) { alert("Please enter valid digit 0-9."); document.Form1.t10.focus(); return false; } if(isNaN(document.Form1.t11.value)) { alert('Invalid contact format!!!'); document.Form1.t11.focus(); return false; } if (document.Form1.t11.value.length<10){ alert('Plz Enter Correct Contact No'); document.Form1.t11.focus(); return false; } alert('Congrats,you are done!!!!!!!!!!'); } </script>

rec :

<script type="text/javascript" LANGUAGE="javascript" > function button_actions( ){ if (!document.f4.t1.value){ alert('You can not leave the field(s) blank of company name!!'); document.f4.t1.focus(); return false; } var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9] {2,4})+$/;

if (!document.f4.t2.value){ alert('You can not leave the field(s) blank of Email!!'); document.f4.t2.focus(); return false; } if(!regex.test(document.f4.t2.value)) { alert("Invalid email address format"); document.f4.t2.focus(); return false; } if (!document.f4.t3.value){ alert('You can not leave the field(s) blank of pwd!!'); document.f4.t3.focus(); return false; } if (document.f4.t3.value.length<6){ alert('Use atleast 6 characters for password!!'); document.f4.t3.focus(); return false; } if (!document.f4.t4.value){ alert('You can not leave the field(s) blank of rpwd!!'); document.f4.t4.focus(); return false; } if (document.f4.t3.value != document.f4.t4.value){ alert('Should be the same with password!!'); document.f4.t4.focus(); return false; } if (!document.f4.t5.value){ alert('plz give company detail'); document.f4.t5.focus(); return false; } var urlregex = new RegExp("^(ftp|https?):\/\/(www\.)?[a-z0-9\-\.]{3, }\.[a-z]{3}$"); if (!document.f4.t6.value){ alert('You can not leave the field(s) blank of Website!!'); document.f4.t6.focus(); return false; } if(!urlregex.test(document.f4.t6.value)) { alert("Invalid URL address format"); document.f4.t6.focus(); return false; } if(isNaN(document.f4.t7.value)) { alert('Invalid contact format!!!'); document.f4.t7.focus(); return false; } if (document.f4.t7.value.length<10){ alert('Plz Enter Correct Contact No'); document.f4.t7.focus(); return false; }

if (!document.f4.t8.value){ alert('plz give the contact persion_name'); document.f4.t8.focus(); return false; } if (!document.f4.t9.value){ alert('You can not leave the field(s) blank!!'); document.f4.t9.focus(); return false; } if(document.f4.d1.selectedIndex==0) { alert("Please select an Item."); document.f4.d1.focus(); return false; } alert('Congrats,you are done!!!!!!!!!!'); } </script>

Вам также может понравиться