ERROR CHECK for Japanese INPUT of Full size characters and Half size characters
Mandatory check is not done for this example site.

This page is a example for Input check logic for AS400.
Because U-Pack delivery label is prepared by AS400, we need to check input characters as much as possible.
In AS400, we can not combine "Full size characters" and "Half size characters".

Example of Full size characters: "FULL SIZE カタカナ0123"
Example of Half size characters: "Half size カタカナ0123"


INPUT FORM:
Last name (Kanji)*  Example: 武田
Please input only full size characters, Maximum of 9 characters.

Last name (Kana)*  Example: タケダ
Please input only full size Ka(taka)na characters, Maximum of 9 characters.

Address1*  Example: 目黒区鷹番3-14-15-801
Please input only full size characters, Maximum of 21 characters.

Phone number*  Example: 03-1245-4444
Please input only half size numbers and hyphens, Maximum of 15 characters.

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>