Forum


HomeHomePremiumPremiumAdministrationAdministrationCompulsory Checkbox in customised Registration formCompulsory Checkbox in customised Registration form
Previous
 
Next
New Post
9/14/2012 8:17 AM
 

Hi all

I've got a question re customising the registration form in DNN6.2.2.

I've created a new Profile Property (under User Account Settings) called AcceptTerms. It is of the type Checkbox. I've selected 'Required' and 'Visible' and added text for the 'Required Error Message' and 'Validation Error Message'.

The problem I have is that the field does not respond as requried. When you open the registration form the field is first of all not marked as being required and you can submit the form without checking the checkbox.

Does anyone know how to fix this so that the checkbox must be checked in order to register?

 
New Post
9/14/2012 9:25 AM
 
Hi,

I understand exactly what you are going through and there is a solution.

But first let me explain why the form is actually working: When you mark a field as "required" you are telling DNN that you want a value for that field. This is simple when it comes down to a text box. But when you have a check box, there will be ALWAYS a value for it. If checked it means "1" if not checked is means "0". So the "required" option for check box get understandably confused as people hope that it will force the new users to check the box.

Instead of a check box, you should use a "True/False" field and in the Validation expression you enter "True" - no quotes around. That should do it for you.

Cheers,
Aderson
 
New Post
9/17/2012 5:47 AM
 

Thanks for you reply Aderson.

I used your susggestion but instead of the True/False field I keptI the checkbox but set the regular expression to '1' so that the result of that field must be 1 (checked) and that worked for me.

Thanks again

Bart

 
New Post
12/29/2013 6:58 PM
 

Hi,

I have the same requirement to set the check box value to true. 

I also tried setting the regular expression to 1, but not working.

Should we write some regular expression.

Regards,

Chitra


 
New Post
12/30/2013 5:46 AM
 

Hi Chitra,

For me it works if you create a checkbox field and under validation expression you just add True .

You can see that working on my test site at http://www.dnntutorial.com - Try to register and you will see.

Cheers,

Aderson

 
Previous
 
Next
HomeHomePremiumPremiumAdministrationAdministrationCompulsory Checkbox in customised Registration formCompulsory Checkbox in customised Registration form



Try FREE
30 days money back guaranteed