Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

jQuery

I want to create two functions and have them both run on the click of a single button. I'm not sure how to do that.
The code creates a loop:
<script>
START LOOP
{start_loop (foreach)}
		$(".submit_to").on("click", validate_form_{row_id});
{end loop}

Open in new window


So it would look like:
$(".submit_to").on("click", validate_form_1);
$(".submit_to").on("click", validate_form_2);
$(".submit_to").on("click", validate_form_3);

Open in new window


All three functions run when one button is clicked.
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robert Granlund

ASKER

When I do this, it only completes the first one and does not activate the others.
I'd need to see your html and other relevant code. Specifically the validation functions.

Do you get any errors on the console?