validate user input client-side
This commit is contained in:
parent
8697c8a618
commit
635c8e900c
2 changed files with 3 additions and 2 deletions
|
@ -5,6 +5,7 @@ namespace App\Form;
|
|||
use App\Entity\User;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
@ -17,7 +18,7 @@ class RegistrationFormType extends AbstractType
|
|||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('email')
|
||||
->add('email', EmailType::class)
|
||||
->add('username')
|
||||
->add('agreeTerms', CheckboxType::class, [
|
||||
'mapped' => false,
|
||||
|
|
|
@ -17,6 +17,6 @@
|
|||
}) }}
|
||||
{{ form_row(registrationForm.agreeTerms) }}
|
||||
|
||||
<button type="submit" class="btn">Register</button>
|
||||
<button type="submit" class="btn btn-lg btn-primary">Register</button>
|
||||
{{ form_end(registrationForm) }}
|
||||
{% endblock %}
|
||||
|
|
Reference in a new issue