# Is there a way to change the autofill input color

**URL:** <https://forum.wixstudio.com/t/is-there-a-way-to-change-the-autofill-input-color/1794>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [April 7, 2023, 9:34pm UTC](https://forum.wixstudio.com/t/is-there-a-way-to-change-the-autofill-input-color/1794 "2023-04-07T21:34:22Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [April 23, 2023, 8:24am UTC](https://forum.wixstudio.com/t/is-there-a-way-to-change-the-autofill-input-color/1794/8 "2023-04-23T08:24:11Z")

</div>

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?

1. What is the ID of your password-element?
2. So you want to check if the password-field is prefilled → onLoad of the page?
3. What if it is? → changing the backgroundcolor of the INPUT-FIELD ?

```javascript
$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.

> **[Window setInterval() Method](https://www.w3schools.com/jsref/met_win_setinterval.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

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](https://russian-dima.wixsite.com/login-system/vnloginmgm)

---

_[View the full topic](https://forum.wixstudio.com/t/is-there-a-way-to-change-the-autofill-input-color/1794)._
