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) »
  • Optional validation
Pages: [1]

Author Topic: Optional validation  (Read 811 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Optional validation
March 23, 2009, 12:28:31 pm
Hello,

We have a requirement that on member sign up the user selects a company from a drop down box (I have changed the custom field to be a dojo drop down box) and then the customer's e-mail is checked to ensure it matches a domain registered against that company. So far so good but the tricky part is that if it doesn't they only want to warn the customer not stop the transaction. Using the validation hook only allows me to stop the transaction.

I was thinking about using dojo or jquery in the form to validate it at that point. I understand civi is moving away from dojo?

So, where is the best place for me to customise this in.

I note that the e-mail address is filled in before the company field but I guess the validation could go on the company field. ie. they could get a message when they fill that in. It would need to retrieve the domains once the company is filled in & check it against the e-mail address already in the field.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Optional validation
March 29, 2009, 06:14:30 pm
My suggestion is to add a drupal_set_message() call (or Joomla equivalent) in the validation hook, but not fail the validation. This should produce a suitable error message.

CiviCRM probably has a function which displays warning / error messages - I'm not sure what it is though - that would be more portable.
@xurizaemon ● www.fuzion.co.nz

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: Optional validation
March 30, 2009, 07:50:18 am

thats a good idea :) had not thought of it :)

the civicrm function is CRM_Core_Session::setStatus

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Optional validation

This forum was archived on 2017-11-26.