0

Is there angular event trigger function, like we have with jQuery for following action?

$('.link').click(function () {
    $('form').submit(); // this will submit form 
});

Please note, that this is not onSubmit function which is mostly <form ng-submit="submit()"/>

1 Answer 1

1

You can use ng-click to call a function in your controller to execute form submission.

$('form').submit()

using jQuery

or

document.getElementById('someForm').submit()

using JavaScript

Sign up to request clarification or add additional context in comments.

1 Comment

@Basit glad it worked out for you. Just be careful of multiple submit buttons inside a form (if you have them)

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.