3

I have two different option boxes in my form and then two different scripts to pull this data on the click is this how I execute both scripts or will this not work?

<input class="form-control" type="button" onclick="fun() && fun2()" value="Submit">

2 Answers 2

3

yes, make it

<input class="form-control" type="button" onclick="fun(); fun2();" value="Submit">

or you can call one function which will call both of them

<input class="form-control" type="button" onclick="fun();" value="Submit">

function fun()
{
  fun1();
  fun2();
}
Sign up to request clarification or add additional context in comments.

Comments

1

Yes thats pretty easy:

function myFunction(){
  functionOne();
  functionTwo();
}

Then you can simply call myFunction on the onklick attribute

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.