diff --git a/static/script.js b/static/script.js index ad849ac..ca75f3c 100644 --- a/static/script.js +++ b/static/script.js @@ -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: '); + if(! partno_v.match(/^([a-zA-Z0-9]{1,20}\s*){1,3}$/g)) { + alert('Invalid part number format. Accepted: '); return; } if(! block_v.match(/^[0-9]+$/g)) {