Primefaces editable p:selectOneMenu chrome autofill problem - javascript

I am trying to cancel chrome autofilling on my inputs using autocomplete="off". I have a case of a <p:selectOneMenu> which have the attribute editable=true. Then, when I focus on the field, chrome autocomplete propose some past texts. How can I cancel this autofilling knowing that the attribute autocomplete is not available for <p:selectOneMenu>?
I have already tried to manage it through javascript, but the onfocus attribute concern dropdown click and not input area focus.

Unfortunately this is not PrimeFaces related. It is that Chrome AutoFill has been a mess over the years.
Here is the thread you want and look at how many times its been updated or answers changed just in the last 3 years.
Disabling Chrome Autofill
Basically Google has gone back and forth about allowing the developer to control what gets autofilled or not and for a while they completely ignore autocomplete="off" saying developers shouldn't decide what a user wants. Then they added some new auto-complete flags. Its a 100% mess in my opinion.

Related

How to disable the address autocomplete for an input on Chrome?

I started with this solution:
<input autocomplete="off"/>
which worked for current safari and firefox, and some chromes. But then I am now trying to do this:
<input autocomplete="hello-<timestamp>-<randomnumber>"/>
That works for firefox, chrome, and safari on Mac, but not for windows. I only want to disable some of the inputs in a form, not all.
How do I get this to work on Chrome for Windows?
This is for a non-password field, like a phone number or username. I understand that you can't really disable autocomplete for passwords these days.
Add to all fields autocomplete="off". Then check which fileds still perform an autocomplete (for the address), and set the ones to autocomplete="address-level4" (thank you #michael crenshaw).
Also I found out, that the autocpmlete happens depending on the naming of the id of the input. So if you want to disable it just do not set the id (which probably isnt what you want depending on how you process the input, thus this is not really a good clean solution).

Can I discover the values that was inputted in the form field?

Lets say we inputted the values 'abacadabra' and 'chimichanga' in the form field
The autocomplete of the browser shows these values when we start to input 'abac..' or 'chimi..'
Can I check the values that was already inputted in the form in some internal variables???
If you're asking if there is a way for a website to retrieve these values, there is not. It would be a HUGE privacy breach and vulnerability.
If you're asking if there is a way for YOU to see these in your browser, often your browser has a setting where you can see these.
For Firefox, this Support Forum question leads to a plugin that allows you to edit your form history.
For Chrome, this PC World article goes step by step on how to find and delete specific entries.
Click the Chrome menu on the browser toolbar and select Settings
Click “Show advanced settings” and find the “Passwords and forms” section
Select Manage Autofill settings.
In the dialog that appears, select the entry you’d like to delete from the list. Click the “x” that appears at the end of the row.

Unable to disable a required field in CRM 2011 online

The 'estimatedvalue' attribute of the opportunity entity is marked as being required. I have it on the form, but have marked it as being disabled, both through the Form UI customization, as well as using javascript, but some other javascript is re-enabling the form after I've disabled it.
The best solution I have so far is disabling the attribute from the callback of a timeout: setTimeout("CommonLib.setDisabled('estimatedvalue', true);", 1);. When the field loads, it loads as disabled, then some other js is enabling the field, then the callback from the timeout runs and disables it again, so you see the field go from grayed out, to black, to grayed out.
There are two other attributes that I've disabled and they stay disabled, but the estimatedvalue is the only one that is actually required, so I'm guessing it has something to do with that.
Any ideas as to what is re-enabling the field?
I dont think it has anything to do with the requirement level but #Anwar may be one explanation. Could you double check if some other custom script might be enabling the field?
I just tried following with the task where subject is the required field and it seems to be working fine:
Xrm.Page.ui.controls.get('subject').setDisabled(true);

Simple user authentication and helpful browsers

I am building on a standard form driven user login panel. Works well enough. All browsers recognize the pattern as a login panel and helpfully offer to store passwords. The way the user login information is then later recalled varies by browser. I focus here on FF, but the problem is universal.
Like any standard form, my login form comprises basic INPUT tags. W3C says that INPUT tags should fire ONCHANGE only ONBLUR. If I wanted to drive an OK (submit) button, say, that was disabled until some information was entered into my form, then W3C standard-compliance means that my OK button does not become enabled until the user clicks away from the field. I don't much like this behaviour and throughout my app, my INPUT tags are backed by JS code that fires ONCHANGE the moment a modifier key goes down. That's all dandy. However...
When FF recognizes my login form, it suggests to recall my login information. When I accept, FF helpfully fills in the two fields and ... my OK button remains disabled (because my keyboard driver, which detects the modifier keys and fires the ONCHANGE event, remains unaware of the form change; FF has pasted the information into the field without the use of the keyboard buffer).
Has anyone come across this problem before and discovered what event browsers fire when information appears "out of nowhere" in an INPUT field?
Thanks.
You're not the first, see:
Trigger javascript event when using Google auto fill on firefox
which suggests
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents

Read-only input in Android Webkit not working

I have a text input field in my web page that I am using to collect a date (via the jQuery Tools .dateinput). The user does not need to be able to type into the field. A dialog box appears when the field is clicked on. This is a problem on my Motorola Droid, because I don't want the soft-keyboard to appear when the field is clicked.
I have tried input.blur() on focus and also setting the field to disabled and readonly. Setting the field to disabled has undesired side effects. Setting the field to readonly works in everything but the Android browser. The browser seems to recognized the "readonly" attribute (or readOnly via javascript), BUT the field does not actually become readonly. When you click it, the soft keyboard still appears and allows you to change the field.
I suppose that this is a bug in the Android browser. Can anyone come up with a clever alternative?
I used a workaround - since I didn't need to actually edit in the input field (like you, I was popping a date picker), I changed to a span with similar styling. The code is kind of trivial once you have the trick, and it's really app specific so I don't have any really for you to see.

Categories

Resources