Symfony NucleosAntiSpamBundle

I have a problem with NucleosAntiSpamBundle in my Symfony project.

I installed it as described and I have something like this (just copied example from their github) while loading the web page:

$form = $this->createForm(ContactType::class, null, array(
        'antispam_time' => true,
        'antispam_time_min' => 10,
        'antispam_time_max' => 60,
    
        // Honeypot protection
        'antispam_honeypot'       => true,
        'antispam_honeypot_class' => 'hidden',
        'antispam_honeypot_field' => 'email'));  

As I can see visualy and also in debugger, the field is added, but is not hidden (it’s visible).

So I added also this to CSS:

.hidden{ 
  display:none; 
}

But the honeypot field is still visible. In debugger I can see:

<input type="text" id="form_email" name="form[email]" class="hidden form-control">

It seems the "form-control" class overwrites the "hidden" class, because when I remove the "form-control" class and use the hidden, it’s properly hidden.

But I am using some bootstrap template and I don’t want to change form-control (I am using it everywhere).
Also I didn’t find a way how to remove the "form-control" class from the honeypot email field.

How can I fix that?

Many thanks

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *