Require one or more check boxes

N

NormK

I would like to require that one or more checkboxes (out of about 20) be
checked. How do I go about doing this?
 
F

Franck Dauché

Hi,

You can do this by code. Before you submit and/or save the form, you can
loop through your xml document and check the value of each node associated
with your checkboxes. You can then save a list of all nodes holding the
value "false". If 1 or more checkboxes were unckecked, you can then display
a message listing all unchecked checkboxes and you exit your procedure
without executing your save or submit.

Does it make sense?

Franck Dauché
 
N

NormK

Would there be a way to do this with data validation instead of code? Apart
from having to do the programming, I expect that using code would not give
the user filling out the form an indication that the field is required (red
box around the checkbox).

The problem I have with the data validation is that it seem slike the
condition part of the dat validation is limitted to five conditions.

I tried setting up a separate data element that has a rule associated with
it setting it to FALSE if none of the checkboxes is TRUE and TRUE if at least
one is TRUE. This can be done since conditionals in rules do not seem to be
limitted to five conditions. That would then allow me to do the validation
against one data element rather than many. However, the value does not seem
to change dynamically as I check or uncheck boxes.

I actually have more than one set of check boxes, and they are nested. I
need the form to require the user to select one or more of A, B, C... If they
check off A, then they need to check one or more of A.1, A.2, ... A.n.

A
A.1
A.2
A.3
..
A.n
B
B.1
B.2
..
B.n
C
..

I successfuly set things up so that the suboptions (A.1 ... A.n) are hidden
unless the user selects A. What I have't succeeded in doing is forcing the
person filling in the form to select at least one.
 
S

slien1

I also have a similar problem, I have a form with many fields on it , this
form also has 2 separate sets of 10 data source fields (FIELD1 thru FIELD10
and FIELD11 thru FIELD20), and each of those fields is bound to its own
separate Check Box Control. (A total of 20 different Check Box fields.)

There are 2 requirements related to theses 10 Check Boxes, they are:

1). Manditory that the user must at least check one of the Check Boxes
available to them or any and all of the Check Boxes if they like... which one
or more they choose to check is up to the user.

2.). If the user checks the last Check Box labeled "OTHER", a Text Box
Field/Control named "DETAIL" immediately appears below that field so that the
user can provided some additional explanation of what they meant when they
checked the "OTHER" Check Box field above it. If the "OTHER" Check Box is
not selected, the Text Box Field remains hidden to the end user.

I would like to use a Data Validation Script for each of the 2 sets of 10
Check Boxes (collectively) and also tie in that the user filled in the Text
Box if the "OTHER" field was selected. I would like to use a Submt Button to
send the data to a SharePoint Form Library. The form is a Registration
Sign-Up Form that users would only be submitting once, and the user will not
be able to edit the data again. Would you be able to provide me with the
steps I need to take AND the validation code script needed to validate the 2
requirements associated to the 2 sets of 10 Check Boxes prior to the user
pressing the Submit button. Or if you can provide me a link to an example
template, I'd be more than happy to go look at it and figure it out there
myself. Your help is greatly appreciated.

Regards,
slien1 (Scott Lien)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top