This commit is contained in:
assar
2017-06-06 17:16:47 +00:00
parent 6214390df4
commit fcab1c5cfd
3 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -83,11 +83,11 @@ function save(partID) {
var quantity_v = $('#quantity-input').val();
var notes_v = $('#notes-input').val();
var datasheet = $('#datasheet-input')[0].files;
if(! partno.match(/^([a-zA-Z0-9]+\s*){1,3}$/g)) {
if(! partno_v.match(/^([a-zA-Z0-9]+\s*){1,3}$/g)) {
alert('Invalid part number format. Accepted: <Part-number-line-1> <Part-number-line-2> <Part-number-line-3>');
return;
}
if(! block.match(/^[0-9]+$/g)) {
if(! block_v.match(/^[0-9]+$/g)) {
alert('Invalid location field. Only numbers accepted.');
return;
}
@@ -153,7 +153,7 @@ function show_part_info(partID) {
$('#datasheet-info').text('<a href="https://www.elab.kth.se/parts/getfile/' + data.datasheet + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>');
else
$('#datasheet-info').text(' ');
$('#edit-button').on('click', function() {
$('#edit-button').click(function() {
init_edit(partID);
});
overlay_in();