TruthInSatire
Programmer
first question is I have a function that I call during onBlur and it works fine. the function puts up and alert window if an initial format is not correct. When I call the function from another function, I get three boxes, not one. I only call the function once.
second question is, if I do a return false in one function to end the function, How do I end the function that called it?
function initalcheck(fld){
ini = fld.value;
var validchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
if (validchars.indexOf(ini.toUpperCase()) < 0)
fld.select(),
alert(fld.name + ' must be one letter between A-Z or a-z');
else
fld.value = ini.toUpperCase();
}
<script language = "javascript" type = "text/JavaScript">
function checkBeforeSave(openform){
initalcheck(document.editemp.initial);
phoneformat(document.editemp.homephone);
phoneformat(document.editemp.workphone);
phoneformat(document.editemp.pochomephone1);
phoneformat(document.editemp.pochomephone2);
phoneformat(document.editemp.pochomephone3);
phoneformat(document.editemp.pocworkphone1);
phoneformat(document.editemp.pocworkphone2);
phoneformat(document.editemp.pocworkphone3);
phoneformat(document.editemp.poccellphone1);
phoneformat(document.editemp.poccellphone2);
phoneformat(document.editemp.poccellphone3);
validdate(document.editemp.birthdate);
validdate(document.editemp.startposition);
validdate(document.editemp.depothiredate);
}
</script> How many software developers does it take to change a light bulb?
None: it works in everyone else’s office, it must work in yours too.
second question is, if I do a return false in one function to end the function, How do I end the function that called it?
function initalcheck(fld){
ini = fld.value;
var validchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
if (validchars.indexOf(ini.toUpperCase()) < 0)
fld.select(),
alert(fld.name + ' must be one letter between A-Z or a-z');
else
fld.value = ini.toUpperCase();
}
<script language = "javascript" type = "text/JavaScript">
function checkBeforeSave(openform){
initalcheck(document.editemp.initial);
phoneformat(document.editemp.homephone);
phoneformat(document.editemp.workphone);
phoneformat(document.editemp.pochomephone1);
phoneformat(document.editemp.pochomephone2);
phoneformat(document.editemp.pochomephone3);
phoneformat(document.editemp.pocworkphone1);
phoneformat(document.editemp.pocworkphone2);
phoneformat(document.editemp.pocworkphone3);
phoneformat(document.editemp.poccellphone1);
phoneformat(document.editemp.poccellphone2);
phoneformat(document.editemp.poccellphone3);
validdate(document.editemp.birthdate);
validdate(document.editemp.startposition);
validdate(document.editemp.depothiredate);
}
</script> How many software developers does it take to change a light bulb?
None: it works in everyone else’s office, it must work in yours too.