From c8dd7d93271e468305be76237178787aa76373bc Mon Sep 17 00:00:00 2001 From: Davide Bongiovanni Date: Tue, 6 Jun 2017 20:34:11 +0200 Subject: [PATCH] Added some input checking --- static/script.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/static/script.js b/static/script.js index 0506409..ad849ac 100644 --- a/static/script.js +++ b/static/script.js @@ -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(' ');