Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 17, 2005 at 01:28 PM

    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

    Add comment
    10|10000 characters needed characters exceeded