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 Drupal Modules (Moderator: Donald Lobo) »
  • Webform validation question
Pages: [1]

Author Topic: Webform validation question  (Read 482 times)

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Webform validation question
February 03, 2014, 01:30:41 pm
In my use case where a social worker creates one or more children contacts using webform,  I'm not sure how the second or subsequent child can get validated.  It's easy to set various fields as required for the first child; but completion of the second and subsequent child contact is optional for the social worker.  So I can't set fields in these records to required...  And I don't see how the validation rules of webform can be manipulated to check these extra contacts - so a contact record could be created that's invalid in CiviCRM.  For example, a user could put only a first name in the second record and it would be accepted by CiviCRM - which is invalid.  BTW, I have installed the Webform validation module. Is there a way of setting up a webform to fix this problem? Something I've missed?
« Last Edit: February 14, 2014, 03:20:18 am by clarkac »
Andy Clark

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Re: Webform validation question
February 14, 2014, 03:20:45 am
Bump - anybody got any ideas ?
Andy Clark

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Re: Webform validation question
February 24, 2014, 01:27:57 pm
I solved this validation problem using conditionals - at the end of contact 2 (the first child) I put a radio button 'Another child' that defaulted to 'No'.  The conditional is set to only display the second child record (actually a fieldset) if 'Another child' is set to 'Yes'.  What's neat about this is that you can set fields as being 'required' on the non-displayed records, which only comes into effect if that record is displayed.

Webform is so cool.... ;)
Andy Clark

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Webform validation question

This forum was archived on 2017-11-26.