I made a new node type that can be created by anonymous users. I want to force them to check a checkbox that says they agree to the "terms of use" before they can submit the form and create the node. I made an integer checkbox, and put the values "0" and "1", and checked the "required" checkbox. But that doesn't seem to make it do what I want.

Does anyone have any ideas on how to do this?

Comments

moshe weitzman’s picture

Category: support » bug

That sounds like a bug.

marcoBauli’s picture

Title: make "terms of use" checkbox required? » Required fields other than 'Text Field' widget are not required

this is happening here and to igorik too.

setting a required text field to any widget other than 'Text Field' fails to be effectively required on node submission / edit.

anyone else?

marcoBauli’s picture

Title: Required fields other than 'Text Field' widget are not required » Required fields other than 'Text Field' widget not really required
Priority: Normal » Critical

bumping this

is any one else experiencing the bug described?

i still notice the same bug with latest 5.x version.

This might be related to some bug in core, as the Checkbox validate module tries to fix, and which can be an interim solution for CCK checkboxes, but not 'select lists'.

joachim’s picture

Version: 5.x-1.6-1 » 5.x-1.9

+1 and confirming with 5.x-1.10

I have just installed Checkbox validate module, and it does not help in this case because the #required attribute for the checkbox is present but empty -- so Checkbox validate ignores it.

Ie, I have this in $form:

    [field_confirm] => Array
        (
            [#tree] => 1
            [keys] => Array
                (
                    [#type] => checkbox
                    [#title] => Confirm
                    [#default_value] => 0
                    [#return_value] => 1
                    [#description] => blah blah
                    [#required] => 
                )

            [#weight] => 10
        )
threexk’s picture

I cannot replicate this problem in 5.x-1.10 for node add. I created a new content type, gave it a required checkboxes field, and attempted form submission without checking anything. It correctly reported that the field was required. I also tested the case that the checkboxes allow multiple values; again it correctly reported the field was required.

joachim: Could you give the specifics of what you are doing to see this problem with checkboxes in 5.x-1.10?

karens’s picture

Status: Active » Closed (won't fix)

The D5 version is no longer being supported. Sorry.