Enhanced input checking

master
Davide Bongiovanni 8 years ago
parent c8dd7d9327
commit 41a2cfceed

@ -92,8 +92,8 @@ function save(partID) {
var quantity_v = $('#quantity-input').val();
var notes_v = $('#notes-input').val();
var datasheet = $('#datasheet-input')[0].files;
if(! partno_v.match(/^([a-zA-Z0-9]+\s*){1,3}$/g)) {
alert('Invalid part number format. Accepted: <Part-number-line-1> <Part-number-line-2> <Part-number-line-3>');
if(! partno_v.match(/^([a-zA-Z0-9]{1,20}\s*){1,3}$/g)) {
alert('Invalid part number format. Accepted: <Part-number-line-1(max 20 chars)> <Part-number-line-2(max 20 chars)> <Part-number-line-3(max 20 chars)>');
return;
}
if(! block_v.match(/^[0-9]+$/g)) {

Loading…
Cancel
Save