A
A
Artur2015-02-13 15:16:19
JavaScript
Artur, 2015-02-13 15:16:19

AngularJS and Symfony Forms or how to remove form action?

Angular doesn't do preventDefault() in ng-submit if the form has an action set, but Symphony adds an empty action even if it's removed from the form options.

Is there an elegant solution to this problem, or an option how to do preventDefault() for the form inside Angular.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2015-02-13
@kovalevsky

Elegantly override the form_start block :)

T
TekVanDo, 2015-02-13
@TekVanDo

you can get (and cancel) the event by passing the event from the template - $event

<form ng-submit="$event..preventDefault(); action();">

<input type="submit">
</form>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question