Enhanced input checking
This commit is contained in:
+2
-2
@@ -92,8 +92,8 @@ function save(partID) {
|
|||||||
var quantity_v = $('#quantity-input').val();
|
var quantity_v = $('#quantity-input').val();
|
||||||
var notes_v = $('#notes-input').val();
|
var notes_v = $('#notes-input').val();
|
||||||
var datasheet = $('#datasheet-input')[0].files;
|
var datasheet = $('#datasheet-input')[0].files;
|
||||||
if(! partno_v.match(/^([a-zA-Z0-9]+\s*){1,3}$/g)) {
|
if(! partno_v.match(/^([a-zA-Z0-9]{1,20}\s*){1,3}$/g)) {
|
||||||
alert('Invalid part number format. Accepted: <Part-number-line-1> <Part-number-line-2> <Part-number-line-3>');
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if(! block_v.match(/^[0-9]+$/g)) {
|
if(! block_v.match(/^[0-9]+$/g)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user