最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - This form is not secure Autofill has been turned off only in chrome - Stack Overflow

programmeradmin5浏览0评论

I get this error when trying to fill the form from chrome in my website.

And this after I submit the form.

This doesn't happen in any other browser, what do I've to do to make the form secure.

I get this error when trying to fill the form from chrome in my website.

And this after I submit the form.

This doesn't happen in any other browser, what do I've to do to make the form secure.

Share Improve this question asked Feb 24, 2021 at 10:13 Aanshumaan ShrijaiAanshumaan Shrijai 1191 gold badge1 silver badge11 bronze badges 4
  • Is your page served via HTTPS or HTTP? And is the protocol used to submit the form data HTTPS or HTTP? If either of them are using HTTP protocol, then that's probably why. You should never send sensitive data over HTTP, as it's not encrypted and it's "visible to others" Is it possible that this is the problem? – OOPS Studio Commented Feb 24, 2021 at 10:16
  • androidpolice.com/2020/08/17/… – kol Commented Feb 24, 2021 at 10:16
  • After some testing it appears that the notice appears when submitting a form to a site with HTTP protocol from a site with HTTPS protocol. – Spectric Commented Apr 26, 2021 at 2:22
  • The only workaround I have found till now is to replace the div element to a form element – Aanshumaan Shrijai Commented Jun 14, 2021 at 9:08
Add a comment  | 

4 Answers 4

Reset to default 8

I have fixed it by using SSL and replace form action http to https. Google work on more form security like website if it's not secure.

Hope this will resolve your problem.

with http

with https

My website is https, but I got the same problem. And I saw

  • in the form tag I wrote:

    <form action="http://mywebsite.com/sendMail.php">
    
  • my endPoint I wrote:

    post = {
        endPoint: 'http://mywebsite.com/sendMail.php', 
    }

No. They should all be https. I've changed them and now everything works fine.

You should do this:

  1. In the form set onSubmit as:

     onSubmit={handleSubmit}
    
  2. Create a function to handle submit:

const handleClick = (e) => {
    e.preventDefault();
   window.open(`mailto:${email}?subject=${subject}&body=${name}: ${message}`);
 }
 

3.Done!

I'm the author of the question.

The only workaround I have found to make it secure is to replace the div element with the form element, but that doesn't give us more control over it, so that's not the best solution, but you can replace the form element with the div element

发布评论

评论列表(0)

  1. 暂无评论