0

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

2 Answers 2

4

Just swap them order

 onclick='this.style.visibility = "hidden"; return loadSubmit();'
Sign up to request clarification or add additional context in comments.

Comments

1

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();'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.