Add row button operational
This commit is contained in:
		| @@ -99,7 +99,7 @@ | |||||||
|                                     <tr> |                                     <tr> | ||||||
|                                         <td><input id="headerKeyInput" placeholder="name"></td> |                                         <td><input id="headerKeyInput" placeholder="name"></td> | ||||||
|                                         <td><input id="headerValueInput" placeholder="value"></td> |                                         <td><input id="headerValueInput" placeholder="value"></td> | ||||||
|                                         <td><button class="modification-button btn-add"><i class="icon-plus"></i></button></td> |                                         <td><button id="btn-newRow" class="modification-button btn-add"><i class="icon-plus"></i></button></td> | ||||||
|                                     </tr> |                                     </tr> | ||||||
|                                 </table> |                                 </table> | ||||||
|                             </div> |                             </div> | ||||||
|   | |||||||
| @@ -251,6 +251,20 @@ function addRow(key, value){ | |||||||
|     headerMap.html(headersMapHtml); |     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){ | function buildRowHtml(key, value){ | ||||||
|     return '' +  |     return '' +  | ||||||
|     '<tr>' + |     '<tr>' + | ||||||
|   | |||||||
| @@ -99,7 +99,7 @@ | |||||||
|                                     <tr> |                                     <tr> | ||||||
|                                         <td><input id="headerKeyInput" placeholder="name"></td> |                                         <td><input id="headerKeyInput" placeholder="name"></td> | ||||||
|                                         <td><input id="headerValueInput" placeholder="value"></td> |                                         <td><input id="headerValueInput" placeholder="value"></td> | ||||||
|                                         <td><button class="modification-button btn-add"><i class="icon-plus"></i></button></td> |                                         <td><button id="btn-newRow" class="modification-button btn-add"><i class="icon-plus"></i></button></td> | ||||||
|                                     </tr> |                                     </tr> | ||||||
|                                 </table> |                                 </table> | ||||||
|                             </div> |                             </div> | ||||||
|   | |||||||
| @@ -251,6 +251,20 @@ function addRow(key, value){ | |||||||
|     headerMap.html(headersMapHtml); |     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){ | function buildRowHtml(key, value){ | ||||||
|     return '' +  |     return '' +  | ||||||
|     '<tr>' + |     '<tr>' + | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user