Reputation: 41
I have a submit button with onclick="return loadSubmit()" and i want to hide it after clicking with this this.style.visibility = "hidden";
i tried to make these two functions in the same button
<input type="image" name="Generate" class="contSubmit" src="generate.png" onclick='return loadSubmit();this.style.visibility = "hidden";' />
but this does not work, what's the solution please?
Thanks
Upvotes: 0
Views: 1940
Reputation: 944545
Since you are going to change the visibility no matter what the result of loadSubmit
is, just swap the statements around so the return statement is last.
onclick='this.style.visibility = "hidden";return loadSubmit();'
Upvotes: 1
Reputation: 60594
Just swap them order
onclick='this.style.visibility = "hidden"; return loadSubmit();'
Upvotes: 4