Search code examples
javascriptinputcode-cleanupis-empty

Empty input onload even if it is saved in the navigator


I would like to clear all the input in my website even if the parameters for logging have been saved by the navigator.

I've tried to do that using that on the concerned input

<input type="text" name="login" placeholder="Adresse E-mail" onload="this.value=''">

Is there an other way for doing that?


Solution

  • What you might want to try use is the autocomplete=off parameter in your input fields.

    <input type="text" name="login" placeholder="Adresse E-mail" autocomplete="off" >
    

    This parameter can also be added to the actual <form> element -

    <form name="myForm" id="myForm" method="post" autocomplete="off" >