Add row button operational

This commit is contained in:
2021-04-14 17:32:01 +02:00
parent 4648bd73ad
commit 49fb63561d
4 changed files with 30 additions and 2 deletions

View File

@@ -251,6 +251,20 @@ function addRow(key, value){
headerMap.html(headersMapHtml);
}
const newRowInput = function(){
const hName = $('#headerKeyInput').val();
const hValue = $('#headerValueInput').val();
if(checkIfInputValid(hName) && checkIfInputValid(hValue)){
addRow(hName, hValue);
}
}
$('#btn-newRow').click(newRowInput);
function checkIfInputValid(input){
return !(input == '' || input == null || input == undefined);
}
function buildRowHtml(key, value){
return '' +
'<tr>' +