Difference between revisions of "Term Agreement"
(Created page with "{{NATS4 Manual | show_sites_admin_section = true }} Within NATS4 you can add an "Agree to Terms" checkbox functionality to your Join Form. This means that if a surfer does no...") |
TmmStephen (talk | contribs) |
||
Line 56: | Line 56: | ||
<pre> | <pre> | ||
<div class="form_input"> | <div class="form_input"> | ||
− | if $errors.custom1}<div class="join_error">{$errors.custom1}</div>{/if} | + | {if $errors.custom1}<div class="join_error">{$errors.custom1}</div>{/if} |
<input type="hidden" name="signup[custom1:1:::::::agree_to_terms]" value="0"> | <input type="hidden" name="signup[custom1:1:::::::agree_to_terms]" value="0"> |
Latest revision as of 20:37, 3 April 2013
Within NATS4 you can add an "Agree to Terms" checkbox functionality to your Join Form. This means that if a surfer does not check to agree to your terms, they will be presented with an error. To do this go to your Sites Admin and click on the Edit Site Templates Icon.
Scroll down until you find the join template and open it to edit.
Non Tracked Checkbox
If you would like to add this functionality, but do not want to track any data related to the "Agree to Terms" checkbox, you can add some Javascript to this template to perform it. The following is a simple example:
You would need to add the following to the <head> section of your join form:
<script language=JavaScript> function agreeToTerms(form){ if (form.agree.checked == false ) { alert('You need to agree to our terms and conditions before continuing.'); //Whatever alert you want for not clicking box return false; }else return true; } </script>
You will need to add the onsubmit="return agreeToTerms(this)" to the end of your <form> tag, like this:
<form action="signup.php" onsubmit="return agreeToTerms(this)">
This would need to be placed in your <form>, right before the submit button may be ideal:
By submitting this form I agree to the terms and conditions.<br /> I accept: <input type="checkbox" value="0" name="agree">
Tracked Checkbox
If you would like to track this data you can do so by setting the checkbox to one of the custom signup join fields on your join form. There are a total of 5 custom signup join fields you can use. ("signup[custom1]" to "signup[custom5]")
You would need to add the following to your join form, this is a simple edit you can change it to better suit your site: (To get to your join form follow the same steps listed above)
<div class="form_input"> {if $errors.custom1}<div class="join_error">{$errors.custom1}</div>{/if} <input type="hidden" name="signup[custom1:1:::::::agree_to_terms]" value="0"> <input type="checkbox" name="signup[custom1:1:::::::agree_to_terms]" value="Agreed to Terms" {if $vars.custom1}checked{/if}> I agree to the terms of this site. </div>
The agree_to_terms can be whatever error you want displayed, you will need to use _, they will be replaced with spaces.
This will need to be added within the <form> tags of your join template.