# How do I make checkboxes required?

**URL:** <https://discuss.workflowgen.com/t/how-do-i-make-checkboxes-required/153>\
**Category:** Visual Studio Web Forms\
**Created:** [December 24, 2007, 12:03pm UTC](https://discuss.workflowgen.com/t/how-do-i-make-checkboxes-required/153 "2007-12-24T12:03:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [December 24, 2007, 12:03pm UTC](https://discuss.workflowgen.com/t/how-do-i-make-checkboxes-required/153/1 "2007-12-24T12:03:52Z")

</div>

Checkboxes cannot be managed by the `FORM_FIELDS_REQUIRED` control in WorkflowGen, since by definition a checkbox is optional.

If you need to have one or more checkboxes on your webform that must be selected (required) before the user can submit the form, you can validate this rule by using the JavaScript below, which can be added to a `CustomFieldValidator` in your webform. This `CustomFieldValidator` would use the WFGENPage `ValidationGroup` as its reference and call the validation JavaScript (e.g. `ClientValidationFunction=ValidateCheckBox`).

The group of checkboxes must have an ID that share the same prefix  
(e.g. `REQUIRED_CHECKBOX_1`, `REQUIRED_CHECKBOX_2`, etc.

1. Edit the checkbox web form control(s):

2. Add a web form `CustomFieldValidator`:

3. Add a JavaScript:

You can use this sample as a starting point to create a parameter-based function that makes checkboxes required based on a comma-delimited list similar in concept to `FORM_FIELDS_REQUIRED`.
