-2

 <button id="take-photo"> Take Image</button> 
 <button type="submit" value="Submit" >Submit </button>

How to run two task on single button click 1. Calling function with ID Next 2.Submit the form with the hidden input value

Below is my effort however it runs only 1 function

<button id="take-photo"  type="submit" value="Submit"  >Click me To fire some functions</button>
KiKu
  • 377
  • 5
  • 22

1 Answers1

0

Just put 2 function after onclick

<button onclick="f(); g();" id="take-photo"  type="submit" value="Submit"  >Click me To fire some functions</button>
Harun Or Rashid
  • 5,589
  • 1
  • 19
  • 21
  • Seems Function word has created the confusion __I want to call the function with ID and then submit the form input value Currently, I am using Tow Buttons looking an option to mergre with one Button – KiKu Sep 19 '18 at 05:48
  • If you merge two button to one and call two function, functions will be called same time. If you have to call one function after another, you have to separate those. Otherwise just put a button and call two. Pass parameter – Harun Or Rashid Sep 19 '18 at 05:53