Skip to content

Commit

Permalink
Fixed issue of Two input field should not be empty while generating t…
Browse files Browse the repository at this point in the history
…able LunarMarathon#33

Fixed the issue of Two input field should not be empty while generating table LunarMarathon#33
 kindly merge it. I have attached the output in the issue discussion comments
  • Loading branch information
Siddheshjondhale committed Oct 15, 2022
1 parent 270a443 commit 224c155
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
46 changes: 45 additions & 1 deletion index.css
Expand Up @@ -334,6 +334,17 @@ body[light-mode=dark] {
--autoCompFontColor: #e1e1e1;
--checkedBgColor: #404A47;
}
/* Changes done by Siddhesh172004 */

body[light-mode=dark] .alert{
padding: 10px;
background-color: #ffffff;
color: rgb(0, 0, 0);
width: 50%;
margin: auto;
}

/* Changes done by Siddhesh172004 */

body[light-mode="dark"] .light-mode-button span:nth-child(1) {
background-color: #ced4e2;
Expand Down Expand Up @@ -387,4 +398,37 @@ body[light-mode=dark] .light-mode-button span:nth-child(2) {
transition: .3s;
}

/* --------------------------------------------------- */
/* --------------------------------------------------- */

/* Changes done by Siddhesh172004 */

/* Alert code starts */
.alert {
padding: 10px;
background-color: #78c992;
color: rgb(0, 0, 0);
width: 50%;
margin: auto;
}
.hide{
display: none;
}
.showalert{
display: block;
}
.closebtn {
margin-left: 15px;
color: rgb(0, 0, 0);
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}

.closebtn:hover {
color: black;
}
/* Alert code ends */
/* Changes done by Siddhesh172004 */
10 changes: 10 additions & 0 deletions index.html
Expand Up @@ -46,6 +46,16 @@ <h1>GRAPH TO TABLE</h1>
</div>

<div class="outerInputDiv">
<!-- /* Changes done by Siddhesh172004 */ -->

<div class="alert hide" id="showalert">
<span class="closebtn" onclick="closethealert()">&times;</span>
<strong>Input field are null</strong> Please enter the some text in input field.
</div>

<!-- /* Changes done by Siddhesh172004 */ -->


<div class="inputCont autocomplete">
<input id="input1" type="text" placeholder="key/node1">
</div>
Expand Down
46 changes: 46 additions & 0 deletions index.js
Expand Up @@ -135,6 +135,20 @@ function autocomplete(inp, arr) {

//Code for creating the table
function createTable() {
/* Changes done by Siddhesh172004 */

// Alert messgae code starts
var showalert=document.getElementById('showalert')
if(input1.value.length==0 || input2.value.length==0){
showalert.classList.remove('hide')
showalert.classList.add('showalert')

return 0;
}

// Alert messgae code ends
/* Changes done by Siddhesh172004 */

autocomplete(document.getElementById("input1"), tableArr);
autocomplete(document.getElementById("input2"), tableArr);
let key = document.getElementById("input1").value;
Expand Down Expand Up @@ -208,6 +222,20 @@ function createTable() {
//----------------------------------------------------------------

}



// to close the alert badge starts

function closethealert(){
var showalert=document.getElementById('showalert')

showalert.classList.remove('showalert')
showalert.classList.add('hide')
}
// to close the alert badge ends


//----------------------------------------------------------------

//Search table code
Expand Down Expand Up @@ -394,3 +422,21 @@ function generateTable() {
});
//----------------------------------------------------------------
}


















0 comments on commit 224c155

Please sign in to comment.