Reputation: 19
The issue I am having is that I want the submit button hidden after
I have chosen a date from a calendar. and submitted it.
The html/script I am using is
...
<input type="button" value="Try it" id="Submit1" onclick= "myFunction();this.form.submit();">
<script>
function myFunction() {
var x = document.getElementById("Submit1");
x.hidden= true;
}
</script>
...
When you have clicked the button it hides the button for a second but then appears again. I guess this when the page is reloaded. Anybody have a solution for this.
Its being written in Classic asp VB
Upvotes: 1
Views: 493
Reputation: 136
try
var x = document.getElementById("Submit1");
x.style.visibility = "hidden";
https://www.w3schools.com/jsref/prop_style_visibility.asp
But this code should be executed after reloading the page, which means that the body of the new page just needs to have code
<script>
window.myFunction();
</script>
The backend side (php, ruby, node ...) can take care of this.
You can call the code from the browser console (F12, then CTRL + `). This will give you a feel for what code you need to run and when.
Upvotes: 1