Jump to content

Autofill how to turn off


RobYost

Recommended Posts

Is there a way to turn off autofill (or maybe called autocomplete) in the application?

 

When filling in the  form the browser  prompts to autofil the Edit fields on the screen.  The information presented to autofill would never be the correct information, so I would like to turn it off in my program.

 

 

It looks like it can be added to the form property, but I don't know how.

 

<form method="post" action="/form" autocomplete="off">

Link to comment
Share on other sites

In Chrome (and probably the other browsers as well) 

go to Settings->Advanced->Passwords and forms

 

There you will see Autofill settings.

 

In there you will see addresses:

with a bunch of addresses (and credit cards), you have filled out on other web pages

 

If you are on a web page that has what chrome thinks is an address it will prompt to put in one the saved addresses.

 

In my case these addresses will never be correct, so I would like to NOT have Chrome prompt with the option to fill in the address fields.

 

From what I found out on the internet if you have a form on a web page and add autocomplete="off" it will not prompt for autocomplete.

 

eg. 

<form method="post" action="/form" autocomplete="off">

 

But I don't know how to add a parameter to the <form>.  I am assuming that somehow we are generating a HTML form.

Link to comment
Share on other sites

I don't know if it will autofill for you.  From reading about autofill it looks like it trys to match things saved by your browser that match the form.

 

So I named the fields Address, City, State, and Zipcode.

 

For me, it suggests items to autofill

AutoFill.zip

post-4889-0-97698700-1512700067_thumb.png

post-4889-0-40354500-1512700177_thumb.png

Link to comment
Share on other sites

Hi.

 

One possible solution:

 

MainmForm -> ClientEvents -> UniEvents -> Ext.form.Panel [form] -> function form.afterCreate:

function form.afterCreate(sender)
{
    sender.element.dom.setAttribute('autocomplete', 'off');
}

Try,

 

Best regards,

Link to comment
Share on other sites

  • 1 year later...
30 minutes ago, FFREDIANELLI said:

testcase , it's just a label with the command.

Sorry, tell me exactly which platform (Desktop or mobile) you want to use.

14 hours ago, FFREDIANELLI said:

Please , there is no MainmForm -> ClientEvents -> UniEvents -> Ext.form.Panel [form] -> function form.afterCreate

MainmForm - It's a mobile form, your test case for the desktop 

?

May this post can help you, can you try?:

 

Link to comment
Share on other sites

Platform: Desktop

Testcase is in the message sent one hour before your answer , with the name 'testcase1.rar'

I think that the approach of putting events on each component of my form is not useful, because its not password, the browser is putting things with autosave in fields like 'Name'... the best is disable completely for the application.

 

 

Link to comment
Share on other sites

18 minutes ago, FFREDIANELLI said:

Testcase is in the message sent one hour before your answer , with the name 'testcase1.rar'

Yes I saw, and you wanted to use a solution that is designed for a mobile platform

OK

We will think about it, but I think it may not always work correctly, in some cases, the browser will continue suggesting autocompletion values even if the autocomplete attribute is set to off (Google that)...

 

Link to comment
Share on other sites

1 hour ago, FFREDIANELLI said:

Ok thanks, but how could i know that your solution was for mobile ?

by opening the images that Rob sent...

Yes, sent screen is a mobile form, you can recognize it at least what the interface looks like

and by this: 

On 12/8/2017 at 1:22 PM, Sherzod said:

MainmForm -> ClientEvents -> UniEvents -> Ext.form.Panel [form] -> function form.afterCreate:

MainmForm

Link to comment
Share on other sites

ok, thanks, only at dblookupcombobox and combobox the problem in realy 'a problem' because we can't see that is in our list, the chrome list is on top of it, all the others field we can type on top.

Is it possible to say to unigui to open the list moved a litle bit do rigth, then our list will be not under the autocomplete list ?

Link to comment
Share on other sites

2 minutes ago, FFREDIANELLI said:

ok, thanks, only at dblookupcombobox and combobox the problem in realy 'a problem' because we can't see that is in our list, the chrome list is on top of it, all the others field we can type on top.

Is it possible to say to unigui to open the list moved a litle bit do rigth, then our list will be not under the autocomplete list ?

Sorry, can you please explain ?!

Link to comment
Share on other sites

I will try, with my poor english, the chrome autocomplete open under the dblookupcombobox and dbcombobox a list of options that it thinks that are useful, the problem is that this list is on top of the original list of options of combobox, not allowing the user to see and chose the list provided by my program. So one simple solution is if i can define somewere in clientevents a command to the list open a litle bit left from the original place that is the begining of the component, it will llooks like this image.

 

chrome.png

Or a more elegant way is open  above the component , lide devexpress allow us with a property.

 

Link to comment
Share on other sites

Maybe you wanted like this?!:

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  //An offset [x,y] to use in addition to the pickerAlign when positioning the picker.
  with UniDBLookupComboBox1.JSInterface do
    JSConfig('pickerOffset', [JSArray([-20,0])]); //JSConfig('pickerOffset', [JSArray([20,0])]);

end;

 

Link to comment
Share on other sites

Almost Perfect ! thanks again ! , but... :blink: how can i calculate the (y-offset) of the  pickeroffset ? in my first test i did by changing, testing, changing , testing... until arrive to the value -322, but i think that this will varry with font size ?  i preffered changing to open on top, it looks more ellegant than my first idea.

  with cbpaises.JSInterface do
    JSConfig('pickerOffset', [JSArray([0,-322])]);

image.thumb.png.93a28b776b051b097c50fb3200cd3d60.png

Link to comment
Share on other sites

35 minutes ago, FFREDIANELLI said:

i preffered changing to open on top, it looks more ellegant than my first idea.

Try this:

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniDBLookupComboBox1.JSInterface do
    //JSConfig('pickerOffset', [JSArray([-20,0])]);
    JSConfig('pickerAlign', ['bl-tl']);

end;

 

Link to comment
Share on other sites

  • 4 months later...

This solution did not help me:

sender.element.dom.setAttribute('autocomplete', 'off');

  But this one works good:

UniSession.AddJS('$("input").attr("autocomplete", "off");');

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...