Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Accept terms checkbox (boolean doctype field with validation) View modes: 
User avatar
Member
Member
seanbun-gmail - 6/17/2009 9:44:53 PM
   
Accept terms checkbox (boolean doctype field with validation)
Hi,

I am trying to add an "Accept Terms and Condition" checkbox in a document type form. This is a checkbox which is compulsory to check if people want to submit the form.

I've created a new field with these set-up

1. Pick "boolean yes/no" as the attribute type.
2. Choose "checkbox" for the field type
3. NOT allow empty value

With these setup, the form still can be submitted even though the checkbox is not checked. No error message pop up. Also, there is no validation property section (like text type) I could find which allow me to customise the error message.

Is there any other way I can implement this checkbox? Please advise.

Cheers,
matt
@seanbun

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/24/2009 6:43:08 AM
   
RE:Accept terms checkbox (boolean doctype field with validation)
Hi,

The problem is that the boolean data type is never empty, it has true/false value, always and nothing else.

You need to use the attribute type text and field type multiple choice, but you will add only one value so only one box will appear, for example you can use: 1;

Then, in the validation you can use regular expression: 1
and enter your custom message.

I hope it makes sense.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
seanbun-gmail - 6/24/2009 7:52:36 PM
   
RE:Accept terms checkbox (boolean doctype field with validation)
Cool. Nice work around.

Thanks again.

Cheers,
matt
@seanbun