cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Kam,

pattern matching 3012*******

e.g. (BOL) "3012" followed by 7 digits (EOL)

http://www.greenend.org.uk/rjk/2002/06/regexp.html

Regards,

Fekke