Imagine the scenario: You installed Webform and Webform Validation. You got a Webform. You set some validation rules. Say, question #1 must be answered "True" and #2 must be "False" or else you failed and you can't submit your form.

So then, you want to override the validation. But you don't want to change the validation criteria, just the actions. Instead of just tossing out a drupal_set_message for each one, you want to count up how many validated and how many didn't. You want to display to the user the correct validation condition for some, but not all, and you want to do it depending on the count.

So where does Webform hide its validation criteria once they've been set? Node_load doesn't show them to you. The Webform API don't give you no love. Because they're stored away by a separate contrib module.

Where do you go?


Webform Validation can help you in this regard. And there is a way to define custom validation rules too through hook.

  • Yes, I am using that module. Sorry I forgot to specify. I'll edit the question.
    – beth
    May 25 '12 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.