Skip to Content
0
Nov 17, 2005 at 12:05 PM

Check Barcode : loc_checkpattern = /^3012\d{7}.$/

26 Views

Hi all,

See the code in the BOLD. What that actually means????

// Check barcode format for Returned outward remittance only

function checkFormat(){

if ( document.all['w_type'].value == 4 &&

document.all['w_level'].value == 1) {

<b> var loc_checkpattern = /^3012\d{7}.$/;</b> var loc_result = document.all['w_barcode'].value.search(loc_checkpattern);

if (loc_result == -1) {

loc_checkpattern = /^3992\d{7}.$/;

loc_result = document.all['w_barcode'].value.search(loc_checkpattern);

if (loc_result == -1) {

document.all['MessageVal'].innerHTML = '&nbsp;&nbsp;&nbsp;Error : Barcode is the wrong format';

errorCheck = 'X';

}

}

}

}

Thanks

Kam