Added some input checking

This commit is contained in:
Davide Bongiovanni
2017-06-06 20:34:11 +02:00
parent f5b1b67fc7
commit c8dd7d9327
+16
View File
@@ -100,6 +100,22 @@ function save(partID) {
alert('Invalid location field. Only numbers accepted.');
return;
}
if(type_v.length > 25) {
alert('Manufacturer name too long (max 25 characters).')
return;
}
if(description_v.length > 200) {
alert('Description too long (max 200 characters).')
return;
}
if(quantity_v.length > 10) {
alert('Quantity info too long (max 10 characters).')
return;
}
if(notes_v.length > 200) {
alert('Notes too long (max 200 characters).')
return;
}
partnos = partno_v.split(' ');