Go to: Sample form to review Zip code
Input error check can be done at Server or at Client by JavaScript. This is just a example to check at Client by JavaScript.
Above input check is done by following.
<script type="text/javascript">
/* Last name Kanji check */
function KanjiCheck() {
var str = document.iform.KanjiText.value;
if( str.match( /[0-9a-zァ-ンーA-Z\s./#&()/-]+/ ) ) {
alert("Please input full size characters only.");
return 1;
}
return 0;
}
/* half zise Katakana check */
function KanaCheck() {
var str = document.iform.KanaText.value;
if( str.match( /[^ーァ-ン]+/ ) ) {
alert("Please input only full size Katakana characters.");
return 1;
}
return 0;
}
/* Address1 input check */
function Address1Check() {
var str = document.iform.Address1Text.value;
if( str.match( /[0-9a-zァ-ンーA-Z\s./#&()/-]+/ ) ) {
alert("Please input only Full size characters.");
return 1;
}
return 0;
}
/* Telephone number check */
function TelCheck() {
var str = document.iform.TelText.value;
if( str.match( /[^0-9-]+/ ) ) {
alert("Please input correct telephone numbers.");
return 1;
}
return 0;
}
/* Check all */
function AllCheck() {
var check = 0;
check += KanjiCheck();
check += KanaCheck();
check += Address1Check();
check += TelCheck();
if( check > 0 ) {
return false;
}
return check;
}
</script>