Checkbox before Registration (JavaScript)

by itsmeJAY 0 Stars 91 Downloads

With this small plugin (code snippet) it is possible to allow the registration process only if a checkbox is activated. The plugin also checks if the checkbox is set on the server side.

Project Details

With this small plugin (code snippet) it is possible to allow the registration process only if a checkbox is activated. The button "I agree" only appears when the checkbox is set. The plugin also checks if the checkbox is set on the server side. So if someone tries to "cheat" with the browser inspector, this will be intercepted / checked on the server side.

Tutorial:
1. download the plugin
2. upload the plugin (all files) completely to your server
3. activate the plugin in the forum (acp)
4. edit the member template "member_register_agreement"
5. Insert this variable BEFORE </body>
{$acceptedScript}
6. Change the following line 
from
<input type="submit" class="button" name="agree" value="{$lang->i_agree}" />
to
{$acceptTerms}<br/>
<input type="submit" class="button" style="display: none" name="agree" id="agree" value="{$lang->i_agree}" />

(Important is that the button gets the id "agree" and the CSS property display: none. Also the variable {$acceptTerms} must be inserted above the button.)

Have fun!
 
-------------------------------------------------

Mit diesem kleinen Plugin (Code-Snippet) ist es möglich, den Registrierungsprozess nur zu erlauben, wenn eine Checkbox aktiviert wurde. Der Button "Ich akzeptiere" erscheint erst, wenn die Checkbox gesetzt ist. Das Plugin überprüft auch, ob die Checkbox serverseitig gesetzt wurde. Sollte jemand also versuchen mit dem Browser-Inspektor zu "schummeln", wird dies serverseitig abgefangen / überprüft.

Tutorial:

1. Lade das Plugin herunter
2. Lade alle Dateien des Plugins auf deinen Server hoch
3. Aktiviere das Plugin im Forum-ACP
4. Editiere das Member Template "member_register_agreement"
5. Füge folgende Variable VOR</body> ein
{$acceptedScript}
6. Ändere folgende Zeile von
<input type="submit" class="button" name="agree" value="{$lang->i_agree}" />
zu
{$acceptTerms}<br/>
<input type="submit" class="button" style="display: none" name="agree" id="agree" value="{$lang->i_agree}" />

(Wichtig ist, dass der Button die id "agree" bekommt und die CSS Eigenschaft "display: none". Ebenfalls muss die Variable{$acceptTerms} über dem Button verfügbar sein.)
Viel Spaß!

Previews

 
Author
itsmeJAY
Collaborators
None
Version
1.1
Submitted
2020-05-25, 07:03 PM
Last Updated
2020-06-21, 04:58 PM
Bug Tracking
Disabled
MyBB Versions
1.8.x