Forums: [SOLVED] Disable Browser Autocomplete for Input Forms - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[SOLVED] Disable Browser Autocomplete for Input Forms Rate Topic: -----

#1 User is offline   David Fleming 

  • Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: 10-December 12

Posted 14 June 2018 - 05:30 AM

I am trying to determine a way to force the browser to disable autocomplete for my input forms. When connecting to my application using Chrome, the browser wants to suggest autocomplete suggestions for each of the typical fields. This is frustrating as most of the date is unique for each record. In one example I have a field to enter a date and Chrome wants to suggest several recent dates I have entered.

I know you can toggle this off on the browser side, but I have read several articles like this one
https://www.scotsscr...o-complete.html
which suggest it can be embedded into the web code.

I need some advice on where to add some specific code to disable browser autocomplete for my application. I have tried inserting a few of the jscript examples in the page load event without success and I've also tried adding a few of the examples to the page HTML.
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15796
  • Joined: 03-February 03

Posted 14 June 2018 - 02:33 PM

You can do that using Javascript onload event of the page in question. Here is the code:

// disable autocomplete for specific field 
var field="EmployeeID";
$("[id^=value_"+field+"]").attr('autocomplete','off');

// disable autocomplete for all fields on the page
$("[id^=value_]").attr('autocomplete','off');

Best regards,
Sergey Kornilov
0

#3 User is offline   David Fleming 

  • Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: 10-December 12

Posted 15 June 2018 - 01:06 PM

This solution worked perfectly!
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic