Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added functionality to cancel button #17

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
}
</style>
<script src="https://code.jscharting.com/2.9.0/jscharting.js"></script>
<script src="script.js"></script>

</head>


Expand Down Expand Up @@ -62,10 +64,24 @@
</button>
<button
class="flex-shrink-0 border-transparent border-4 text-blue-500 hover:text-blue-800 text-sm py-1 px-2 rounded"
type="button"
type="button" id ="cancel"
>
Cancel

</button>

<script>
const cancelbutton = document.getElementById("cancel");

cancelbutton.addEventListener("click",function(){
document.getElementById("curlInput").value ="";


});

</script>


</div>
</form>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/frontend/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function useConfig(config) {

document.getElementById("reportForm").addEventListener("submit", function(event) {
event.preventDefault(); // Prevent default form submission


// Get the value of the location input field
var location = document.getElementById("curlInput").value;
Expand Down Expand Up @@ -94,4 +95,8 @@ document.addEventListener("submit", function() {
}
// Call the function to fetch data and update HTML content when the form is submitted
fetchDataAndUpdateHTML();
});
});