|
|
|
@ -67,7 +67,7 @@ $addStockBtn.click(function(event) { |
|
|
|
|
var text = $('input[name=assetSelect]').val(); |
|
|
|
|
// const selectedStock = text;
|
|
|
|
|
// var text = $('#stock-select option:selected').text();
|
|
|
|
|
console.log(text) |
|
|
|
|
// console.log(text)
|
|
|
|
|
if (text != null && text!= '' && stockList.indexOf(text)===-1) { |
|
|
|
|
// Add new item to list
|
|
|
|
|
addStockItem(text, text); |
|
|
|
@ -75,7 +75,7 @@ $addStockBtn.click(function(event) { |
|
|
|
|
// Clear input field
|
|
|
|
|
$('#stockAll').val(''); |
|
|
|
|
} |
|
|
|
|
console.log(stockList); |
|
|
|
|
// console.log(stockList);
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Event listener for submit button click
|
|
|
|
@ -83,7 +83,7 @@ $submitPort.click(function(event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
if (stockList.length > 1){ |
|
|
|
|
$('#portModal').modal('show');
|
|
|
|
|
console.log('asset confirm'); |
|
|
|
|
// console.log('asset confirm');
|
|
|
|
|
// $(this).prop('disabled', true);
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -120,8 +120,7 @@ $sendPort.click(function(event) { |
|
|
|
|
}, |
|
|
|
|
error: function(xhr) { |
|
|
|
|
console.log('Error submitting stock list: ' + xhr.responseText); |
|
|
|
|
alert('建立失敗,請確認資產名稱是否正確!'); |
|
|
|
|
location.reload(); |
|
|
|
|
alert('建立失敗,請確認資產名稱是否正確! 美股代號均為大寫、台股代號為數字後接".TW"或是"TWO"'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$commentPort.val(''); |
|
|
|
|