Reputation: 721
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.
Please let me know the workaround.
Upvotes: 1
Views: 168
Reputation: 713
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 :-)
Upvotes: 1