Reputation: 1
Here is the form tag which I want to add validation to:
{% form 'customer_address', customer.new_address %}
<div>
<input type="submit" class="btn" value="{{ 'customer.addresses.add' | t }}" />
</div>
{% endform %}
Upvotes: 0
Views: 1843
Reputation: 163
The {% form 'customer_address', customer.new_address %} return an HTML form:
<form method="post" action="/account/addresses" id="address_form_new" accept-charset="UTF-8">
so you could use the id #address_form_new or the action attribute: [action="/account/addresses"]
$('#address_form_new').on('submit', function(e) {
// Your validation
});
Upvotes: 1