1

I want to hide whatever user types in field wpc_crewid. I've tried with passwordInput like below -

<?= $form->field($modelsProductsales, "[{$i}]wpc_crewid")->label(false)->passwordInput(['maxlength' => true,'autofocus' => 'autofocus','placeholder' => 'Crew ID No','autocomplete' => 'off','class' => 'crewid']) ?>

This is working, but it is showing a dropdown whenever user puts cursor on this field. I don't want this dropdown to appear.

enter image description here

Please let me know the workaround.

Alias
  • 611
  • 13
  • 42

1 Answers1

1

now browsers have started to override the auto-complete off so adding auto-complete will not work

Browsers look for the first input type password and one more input before that considering it as username , so you can use trick to fool browsers by adding the following code at the start of your form

 <input style="opacity: 0;position: absolute;">
 <input type="password" style="opacity: 0;position: absolute;">

hope this helps :-)

Ash-b
  • 605
  • 6
  • 10