RSS

LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / LuxCal / Comments and Suggestions / User Registration add Check Box to agree to Terms of Use?
Posted:  19 Oct 2014 13:45
Hi Roel,

This isn't something that would apply to everyone but might for a number of us allowing users to register and post listings.

The Terms of Use and also a Privacy Policy might be required. For example the Terms of Use would be whom can register and post events and also what types of events can be posted. Since they are entering their email address will it be kept private or shared with others.

In Canada effective July 01, 2014 if we are to send any commercial electronic message we need your express consent before we do. We also can't have a pre-checked box, the user must actively select the box to give their express consent.

Regards,
Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  21 Oct 2014 01:06
I have just done this thing for one of my forms so for you that need to do this, here is the easiest way to do it.

I added in a check box option at the end of my form before the submit button  -it  is not checked by default.  Here is the code

Code:


<label class="description" for="element_15">I have read the terms and conditions of booking and I agree to abide by them </label>
        <span>
            <input id="element_15_1" name="TERMS" class="element checkbox" type="checkbox" value="1" />
<label class="choice" for="element_15_1">Yes</label>

Note the name="TERMS" part

I then put an extra bit of code for when the form is submitted - again here is the code

Code:


onclick="if(!this.form.TERMS.checked){alert('You must agree to the terms first.');return false}"

In the part of the line that says this.form.TERMS.checked the word TERMS must be changed to be the sme word used in the first part of the code where I have TERMS.

When a user clicks the submit button the code will check first that the TERMS are checked and if not it will pop up a box with the message that is after the alert part of the code.

and here is is in the full submit button code so you can see where this extra bit goes

Code:


<input type="submit" name="email_submit" value="submit" onclick="if(!this.form.TERMS.checked){alert('You must agree to the terms first.');return false}"  />


Hope this helps smile
Posted:  21 Oct 2014 02:31
Thank you for your fairly detailed reply. Unfortunately I'm a complete non programmer that requires step by step instructions when it comes to php code.

You mention: I added in a check box option at the end of my form before the submit button  -it  is not checked by default.  Here is the code


You don't say which form is which folder, I found a eventform0.php and a eventform1.php is the /pages folder but don't appear to find a form.php in any folder.
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  21 Oct 2014 08:19
Ok, I had used that code on another form I was doing at the time and not with the LuxCal.

But I have had a look at it in lc and here is a way you can get it to work

Go to pages > eventform1.php

Back up this page before you do anything else - copy it to anther place.  When working with code always back up - the last thing you want to do is not have a page you can revert to if everything goes horribly wrong.

Look to about line 170 or there abouts which says

Code:


<div class='floatC noPrint'>n";


On that line, straght after it put ?>

So the new line will now be

Code:


<div class='floatC noPrint'>n"; ?>


that closes the php code so that we can put in plain html code to create the terms and conditions as well as the check box.

Next, straight after that put in the following lines

Code:


<label class="description" for="element_15"><b>I have read the terms and conditions of booking and I agree to abide by them </label><br>
        <input id="element_15_1" name="TERMS" class="element checkbox" type="checkbox" value="1" />
<label class="choice" for="element_15_1">Yes</label></b><br>

<?php

That puts in the terms and conditions as well as the check box. If you want to change anything you jest need to make changes to the part that says I have read the terms and conditions of booking and I agree to abide by them


Now go further down about 2 lines and you will find

Code:


echo "<input type='submit' name='add_exe_cls' value="{$xx['evt_add_close']}">
        &nbsp;&nbsp;<input type='submit' name='add_exe' value="{$xx['evt_add']}">";


Replace those 2 lines with these 2

Code:


echo "<input type='submit' name='add_exe_cls' value="{$xx['evt_add_close']}" onclick="if(!this.form.TERMS.checked){alert('You must agree to the terms first.');return false}">
        &nbsp;&nbsp;<input type='submit' name='add_exe' value="{$xx['evt_add']}" onclick="if(!this.form.TERMS.checked){alert('You must agree to the terms first.');return false}">";


This replacement is making sure that the TERMS have been checked first.

that should be it.
Posted:  21 Oct 2014 11:49
Sorry it didn't work, I don't get an error but there isn't a check box. It still only shows "Register" when I click on the link to register.

http://i224.photobucket.com/albums/dd247/Danwest_02/Catch%20All/register_zps6b576a31.png
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  21 Oct 2014 11:59
Here is the complete section from line 182 inclusive of line 191 with your changes, I believe I have everything exactly as you instructed.

Code:


<div class='floatC noPrint'>n"; ?>
<label class="description" for="element_15"><b>I have read the terms and conditions of booking and I agree to abide by them </label><br>
        <input id="element_15_1" name="TERMS" class="element checkbox" type="checkbox" value="1" />
<label class="choice" for="element_15_1">Yes</label></b><br>

<?php
if ($mode == "add" or $mode == "add_exe") {
    echo "<input type='submit' name='add_exe_cls' value="{$xx['evt_add_close']}" onclick="if(!this.form.TERMS.checked){alert('You must agree to the terms first.');return false}">
        &nbsp;&nbsp;<input type='submit' name='add_exe' value="{$xx['evt_add']}" onclick="if(!this.form.TERMS.checked){alert('You must agree to the terms first.');return false}">";
} else {


Regards,
Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  22 Oct 2014 06:50   Last Edited By: Roel B.
ahh - did you need that on the register form?  I thought you wanted it on the add events form!  Let me know where you want it and I will have a look and see what I can work out for you.
Posted:  22 Oct 2014 21:17
I need it on the register form in the screen shot above.

Ideally there would be a links to the "Terms of Use" and "Privacy Policy" and a check box they would have to click to select that says "I agree to the Terms of Use conditions and Privacy Policy." then they would click "Register". If the box isn't checked they can't register.

Thanks,
Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html