Chrome with auto-refill, change the value of a form

0

I am showing a form for data maintenance and, at least in one field, I see for instants e, value that I publish, but, automatically Chrome crushes it with another value. In the image that I share, you can see that I indicate a value, for a field, but another screen appears

The form looks like this: link

This is the code of the form, and it does not matter what you put in autocomplete

<form action="<?=$_REQUEST['url'];?>"  onsubmit="return validaUsuario(this)" autocomplete="aaaa" method="POST">


            <input type="hidden" value="<?= $request->getAttribute('delete')?>" name="delete"/>
            <div class="form-group">
                <label for="usuario_id">Id</label> <input type="number"
                    value="<?= $datos->getUsuario_id()?>" name="usuario_id"  class="form-control"
                    readonly="readonly" />
            </div>
            <div class="form-group">
                <label for="usuario_nombre">Nombre</label> <input type="text"
                    value="<?= $datos->getUsuario_nombre()?>" name="usuario_nombre" required  class="form-control"
                    <?= $read ?> />
            </div>
            <div class="form-group">
                <label for="usuario_apellidos">Apellido</label> <input type="text"
                    value="<?= $datos->getUsuario_apellidos()?>" name="usuario_apellidos" <?= $read ?>  class="form-control" />
            </div>
            <div class="form-group">
            <?php var_dump($datos);?>
                <label for="usuario_correo">Correo Electónico</label> <input type="mail"
                    value="<?= $datos->getUsuario_correo()?>" name="usuario_correo" <?= $read ?> required  class="form-control"/>
            </div>
            <div class="form-group">
                <label for="usuario_password">Contraseña</label> <input type="text"
                    value="<?= $datos->getUsuario_password()?>" name="usuario_password" <?= $read ?> required  class="form-control"/>
            </div>
            <div class="form-group">
                <input type=submit value="<?=$_REQUEST['opcion'];?>" class="btn btn-default" />
            </div>

        </form>
    </div>
</div>

and to simplify a view of the source that the browser receives link

Only works badly in Chrome; both in Firefox and IE (Eclipse) looks good. Do you know how to solve it?

    
asked by migarcia 28.12.2018 в 08:29
source

1 answer

1

To prevent the browser from filling fields you must use autocomplete="none" in each field. For example:

<form action="/action_page.php" >
  First name:<input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  E-mail: <input type="email" name="email" autocomplete="none"><br>
  <input type="submit">
</form>

In the previous example you are preventing the browser from automatically filling in an email previously stored. Greetings!

Documentation

    
answered by 28.12.2018 в 18:14