diff --git a/static/script.js b/static/script.js index 6bbc880..7aefe19 100644 --- a/static/script.js +++ b/static/script.js @@ -117,7 +117,7 @@ function save(partID) { return; } - partnos = partno_v.split(' '); + var partnos = partno_v.split(' '); var data = new FormData(); @@ -128,8 +128,12 @@ function save(partID) { data.append('partno', partnos[0]); if (partnos.length > 1) data.append('partnoalt', partnos[1]); + else + data.append('partnoalt', ''); if(partnos.length > 2) data.append('partnoalt2', partnos[2]); + else + data.append('partnoalt2', ''); data.append('description', description_v); data.append('quantity', quantity_v); data.append('notes', notes_v);