Based upon what you wrote, I think you meant to check the dob.
1st: I would use switch
2nd: Write up a function to get the value length
3rd: Conditional operator
function yourFunc(){
noinf = document.form.noi.value;
if noinf != "" {
var inf_length = getValueLength('birthday'+ noinf);
do_not_check_full_dob = (inf_length > 0) ?
( (inf_length < 8)? true: false) : false;
} // if noinf != ""
.... your other operations...
} // end yourFunc()
}
/** get the length */
function getValueLength(controlID){
if (document.form.controlID) {
return document.form.controlID.value.length;
}
}
|