HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

case 4:
case 8:
case 11:
if (last_character != '-') {
value = value.substring(0,
current_length - 1);
}
break;
default:
if (!/\d/.test(last_character)) {
value = value.substring(0,
current_length - 1);
}
}
if (current_length > 12) {
value = value.substring(0, current_length



  • 1);
    }
    current_length = value.length;
    switch (current_length) {
    case 3:
    case 7:
    case 10:
    value += "-";
    }
    input_object.value = value;
    }
    }


    Form management



    Enter here a serial number in the pattern XXX-XXX-XXX, where each X is a digit: id="serial" type='text' size='12' onkeyup="correct();">.




Free download pdf