Ok, when using predefined stuff, in most cases you don’t have all the options to work with (to be able to use).
The autofill you are talking about does not really come from Wix.
It is generated out from your own Browser. A browser-function, which works on PASSWORD-FIELDS (on my opinion).
So now your goal is to change color, when the Password-Field is auto-prefilled?
- What is the ID of your password-element?
- So you want to check if the password-field is prefilled → onLoad of the page?
- What if it is? → changing the backgroundcolor of the INPUT-FIELD ?
$w.onReady(function(){
if($w("#pwInputFieldIDhere").value) {
console.log("PW-Field has data inside --> green-color");
$w("#pwInputFieldIDhere").style.backgroundColor="green";
}
else {
console.log("PW-Field has data inside --> red-color");
$w("#pwInputFieldIDhere").style.backgroundColor="red";
}
});
But i don’t think this will work.
What would maybe work is a kind of cyclic-checking-function → using → INTERVAL-FUNCTION <— to check periodic → for example → every 3 sec, if the INPUT-FIELD already has a → VALUE.
Generate your Interval-Function, to check if your PW-FIELD already has a value or not. If so → stop Interval-Check.
Last option would be the onChange-Event of the PW-INPUT-FIELD itself.
But also here not sure if this event ever gets triggered.
Test it out.
I would have to rebuild all your setup first to test it (sorry, i don’t have the time for it).
Maybe i will test it on my own created Login-System here…
https://russian-dima.wixsite.com/login-system/vnloginmgm