Take the 2-minute tour ×

I have added some check boxes in my drupal form. User can select either one option or two or all the three given there. Though am able to throw a validation error that at least one of the check boxes should be selected, am not able to validate if two or three are selected or not and the values are also not getting stored in the database provided.

How to do the validation so that whatever values are selected, its getting stored in the database?

Requesting help please.

share|improve this question
add comment

1 Answer

Storing the values in the database isn't typically part of the validation handler, it's usually handled by a submit handler function. The specifics of how the data should be stored depends a lot on what the data is and how it's going to be used, so you'd need to provide some more details in order to get a more concrete answer there.

In general, I'd recommend checking out the Examples for Developers project, which provides lots of working code samples that demonstrate various aspects of Drupal development, including a form example.

share|improve this answer
Thanks Matt. I got the required stuff . –  ezaz hussain Dec 21 '12 at 12:59
add comment

Your Answer


