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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • No asterisks marking credit card fields as required
Pages: [1]

Author Topic: No asterisks marking credit card fields as required  (Read 874 times)

dpolant

  • I’m new here
  • *
  • Posts: 7
  • Karma: 1
No asterisks marking credit card fields as required
September 02, 2010, 01:28:00 pm
On my civicrm 3.1.3, and now on my 3.2 latest, credit card fields on contribution pages do not display an asterisk although they validate as required. Meaning, if I submit the form without them, I do get error messages about their not being filled in, but there is nothing to notify users that the fields are required.

Here is the research I've done:

I've found line 378 in CRM/Contribute/Form/Contribution/Main.php that calls the buildCreditCard method without the argument to make it required. Even without this argument, the cc fields generated in buildCreditCard are "partially" required, in that validation rules take effect, but required markers do not display in the template. If I pass TRUE to this $useRequired argument, the asterisks show up - but the pay later button no longer works because it thinks it has to validate those fields.

Has anyone run into this issue? If so, I am interested in solutions that don't involve hacking core. If it turns out that hacking civi is the only solution, I'd like to know if developers think this issue could be fixed in a civi update.

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: No asterisks marking credit card fields as required
September 02, 2010, 01:42:59 pm

from a quickform perspective (our underlying form library), those fields are not required in all cases and hence there is no red asterick

we can tighten the cases as follows:

if pay later is enabled, or pledge is enabled or paypal is the PP, then dont make it required else make it required

if you just want to change the template and display the asterick, u can customize the template and add the asterick

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

dpolant

  • I’m new here
  • *
  • Posts: 7
  • Karma: 1
Re: No asterisks marking credit card fields as required
September 02, 2010, 01:58:00 pm
Customizing the template is always an option, I will probably end up doing it this way for now.

I like the idea of tightening the cases so that the marker displays unless the field truly isn't required.

scolson

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
Re: No asterisks marking credit card fields as required
September 02, 2010, 02:31:07 pm
It seems like this should have two changes in core:

1. Update data validation rules and page generation rules for when this should be treated as required.

2. Change javascript behaviors to update the flagging on those fields depending on other on-page variables (eg. pay later checkbox is set and credit card div gets hidden triggers an unflagging of those required fields)

Not updating the fields when they are or are not required breaks the user experience and confuses people as to why they get errors when filling out only part of the credit card form.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • No asterisks marking credit card fields as required

This forum was archived on 2017-11-26.