Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
2.3k views
in Q2A Core by

I think this checkbox is essential for every forum. I don't know all laws in all countries, but in those that I know you have to make clear what happens to the content a user posted. You must have a box "I accept the terms and conditions" via checkbox that has to be clicked on registration page.

What happens with all our information here on http://www.question2answer.org/qa/ - it is not clear to me?! License? CC, GPL or full copyright? If not pointed out differently, as far as I know, the users owns all the copyright of their text. And nobody else can use it.

Because this is not implemented in core, the workaround for me was:

1. "admin/users" → Custom message in registry form:

<input id="nutzbed" type="checkbox" name="nbed_check" class="tc" />  <label><a href="http://mydomain.com/terms" target="_blank">Yes, I accept the terms and conditions.</a></label>

2. And use Jquery to check if this checkbox is checked when the user clicks on submit:

    // registration form: must tick checkbox
    if ($("#nutzbed").length > 0){
        var regForm = $(".qa-form-tall-table").parent();
        regForm.submit(function(e) {
            if(!$('input[type=checkbox]:checked').length) {
                e.preventDefault();
                $("#nutzbed").parent().parent().css("background-color","#FF6691");
                alert("Please accpet our terms and conditions.");
                window.scrollTo(0,50);
                return false;
            }
            return true;
        });
    }
 

But I think there should be a core solution, POSTing the checkbox to the server, and if not checked, throwing an error back.

Feel free to correct me if I am wrong.

Q2A version: 1.6.2
by
Just saw, when registering for GSCE, that they write: "When clicking on this button you accept our terms and conditions." --- no checkbox at all. This, by the way, would probably be invalid in German law.

1 Answer

+1 vote
by

Hi, 

Can try this code HTML5

  • Login and go to Administration
  • User
  • Custom message on register form - HTML allowed:

Add this code :

<form ... onsubmit="return checkForm(this);">
<p><input onchange="this.setCustomValidity(validity.valueMissing ? 'Please indicate that you accept the Terms and Conditions' : '');" id="field_terms" type="checkbox" required name="terms"> I accept the <u>Terms and Conditions</u></p></form> 

<script type="text/javascript"> document.getElementById("field_terms").setCustomValidity("Please indicate that you accept the Terms and Conditions"); </script>

Works on Q2A Ver 1.6.3

Let me know if this works for another version

Cordially Claude

...