Developer forum

Forum » Development » Chrome and edge autocomplete triggers antispam

Chrome and edge autocomplete triggers antispam

Lasse Larsen
Reply

We are experiencing problems with the auto complete in chrome and edge triggering the anti spam functionality.



It fills the description field with the username it remembers from the login page.



It seems that the problem stems from autocomplete="off" not being respected on login fields in modern browsers.

i cant really see any way to modify the FormAntispam.cs functionality, is there any other ways to get around this problem?


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Lasse

Oh, yes - Chrome changed that once again...

Investigating a bit, I've found that they have changed how autocomplete works in 110 causing the first random field to be filled with username if there is a password field anywhere. Of just because it can....

The solution can be to add some fields to your form template:

<input type="text" name="_dw_username" value="" style="display:none!important" />
<input type="password" name="_dw_password" value="" style="display:none!important" />

This will cause Chrome (and probably LastPass) to fill those 2 fields - and they are not used in the antispam - I just invented the names.

Further, you can change the autocomplete="off" with autocomplete="one-time-code" - as that should also prevent the browser from filling - I have not tested that yet though.

Depending on how your form template looks like, you can do this crappy hack:

@formSystemFields.Replace("off", "one-time-code")

Let me hear how it goes!

Thanks, Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum