Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Knockout and Autofill issue

1102760Mar 20 2017 — edited Sep 20 2019

Hi All,

I have a login form with 3 fields Username, Password and Account name (all three set to required true and autocomplete="off")

<input id="loginemail" autocomplete="off" data-bind="ojComponent: {component: 'ojInputText', value: loginemail, placeholder: 'Registered email address', required: true}">

<input id="loginpassword" autocomplete="off" data-bind="ojComponent: {component: 'ojInputPassword', value: loginpassword, placeholder: 'Password for the PIC account', required: true}">

<input id="accountname" autocomplete="off" data-bind="ojComponent: {component: 'ojInputText', value: accountname, placeholder: 'PIC account name', required: true}">

Everything works fine except:

  1. Even though autocomplete="off", Chrome still offers to save the username and password (seems like a Chrome quirk). As a result of this, if a user chose to save the credentials, Chrome will autofill the form but will not trigger a Knockout state change. This causes issue as the API gets the username, password field as "". Online there are workarounds suggested including one from Knockout (Knockout : The "textInput" binding ). How do I use it with ojInputText ?
  2. Does "required: true" just add a * to the label or it also checks if the field is actually populated ? Its a hit or miss, sometimes it works sometimes it does not. Is this also related to Knockout change event not being fired correctly ?

How to handle these issues ?

Comments
Post Details
Added on Mar 20 2017
2 comments
614 views