You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is AJAX form. I need to mention that I've set the novalidate attribute on the <form> tag because I don't want a browser validation. I utilize own Twig template extending the default one.
{% extends "forms/default/form.html.twig" %}
{% block form_classes %}
class="{{ form_outer_classes }} {{ form.classes }}" novalidate
{% endblock %}
{% block inner_markup_buttons_end %}
</div>
<div id="form-result"></div>
<script>
$(document).ready(function(){
var form = $('#registration-form');
form.submit(function(e) {
// prevent form submission
e.preventDefault();
// submit the form via Ajax
$.ajax({
url: form.attr('action'),
type: form.attr('method'),
dataType: 'html',
data: form.serialize(),
success: function(result) {
// Inject the result in the HTML
$('#form-result').html(result);
}
});
});
});
</script>
{% endblock %}
Forms plugin returns validation message related to the text field but talks nothing about the checkbox which is expected to be validated as well:
On the other hand, when I fill just the first name, the form is sent.
The text was updated successfully, but these errors were encountered:
The form definition:
This is AJAX form. I need to mention that I've set the novalidate attribute on the
<form>
tag because I don't want a browser validation. I utilize own Twig template extending the default one.Forms plugin returns validation message related to the text field but talks nothing about the checkbox which is expected to be validated as well:
On the other hand, when I fill just the first name, the form is sent.
The text was updated successfully, but these errors were encountered: