CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Turn off autocomplete during payment
Pages: [1]

Author Topic: Turn off autocomplete during payment  (Read 1399 times)

rs3515

  • I’m new here
  • *
  • Posts: 29
  • Karma: 1
Turn off autocomplete during payment
May 04, 2008, 04:22:11 pm
After testing our Main.tpl template page, we realized CiviCRM by default allows autocomplete for all fields.  I tend to think this is not a good idea for pages where credit card information is being provided.  If the website is used on a public computer, autocomplete provides a security risk.  So, we edited the Payment/Form.php file to have 'autocomplete' => 'off' as an added attribute for all fields.

This works well, except for a couple of CiviCRM custom profile fields that have been added to the page.  The custom fields of course are not in the Form.php file, so which file would I need to edit to ensure these fields can also be set to autocomplete=off?

Also just more of a general comment, I'd recommend enhancing CiviCRM to either automatically set autocomplete=off for all payment-related fields, or allowing an admin to set this option somewhere in the software.
« Last Edit: May 04, 2008, 09:05:52 pm by rs3515 »

rs3515

  • I’m new here
  • *
  • Posts: 29
  • Karma: 1
Re: Turn off autocomplete during payment
May 06, 2008, 04:09:31 am
I was able to fix this for all fields in the form by adding autocomplete=off to the templates/Form/default.tpl file.  I noticed there is a {$form.attributes} variable included in default.tpl, but I have no idea where this is set.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Turn off autocomplete during payment
May 06, 2008, 02:40:23 pm
If it's ok for your cases to specify this behavior at the form level for ALL forms, your approach of doing it in default.tpl seems quite good. You can make this a "custom version" of that template so it's retained through upgrades. We don't explicitly set "special" attributes at the form level other than the base ones need for the <form /> element (e.g action=, method= etc.).

Pretty sure what we're going to do for 2.1 is disable it at the field level for billing ("payment") fields only on "front-end" forms (online contributions, event registration, membership signup/renewal). http://issues.civicrm.org/jira/browse/CRM-3060
« Last Edit: May 06, 2008, 02:49:31 pm by Dave Greenberg »
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Turn off autocomplete during payment

This forum was archived on 2017-11-26.