Checkbox-style with validation

5 replies · opened May 31, 2017

BbenjaminbachMay 31, 2017

Hello,
I have a question quite similar to: http://support.semicolonweb.com/forums/topic/how-can-i-add-a-checkbox-required-for-privacy-policy-on-form/
Obviously, the suggested code is already added to the canvas theme.

I have very hard time to get the validation for a custom checkbox running. E.g. following code does not work:


I read and agree the terms of use

with the jQuery validation js:

$('#register-form').validate({
		rules: {
			'register-form-tou': "required"
		},
		messages: {
			'register-form-tou': {
				required: "You need to agree the terms of use"
			}
		}
	});

It is setting the error and so on very good, but it does not update the checkbox (tick it on click). Is there no build in functionality for that, or is a workaround necessary?

Thank you very much for your help!

SSemicolon WebSTAFFJun 1, 2017

Hello,

Can you please provide us with a Live URL so that we can check out the exact issue and provide you with a more accurate solution for this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

SSemicolon WebSTAFFJun 2, 2017

Hello,

Thanks for your Patience! Please find the following code in the css/radio-checkbox.css File:

.checkbox-style:checked + .checkbox-style-3-label:before

and replace it with:

.checkbox-style:checked ~ .checkbox-style-3-label:before

This should definitely fix the issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

BbenjaminbachJun 2, 2017

Thank you very much, thank fixed the issue.

I had to do the same in the css/color.css to get the same color :)

SSemicolon WebSTAFFJun 6, 2017

Hello,

Really Glad that your issues were resolved. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard