[Solved]: How do I make " I agree" checkbox on the bottom of disclaimer? [Solved]: How do I make " I agree" checkbox on the bottom of disclaimer?
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

[Solved]: How do I make " I agree" checkbox on the bottom of disclaimer?

Started by pawelfoto, December 12, 2009, 05:00:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pawelfoto

I want to force users to click on " I agree" checkbox on the page with disclaimer,  before they will continue  registration process.

I dont know html/javascript at all,  so this is big problem for me.

Would anybode help me with this?


My gallery: www.pawelfoto.com


Joe Carver

The default behavior is for the disclaimer to be shown. But since you don't have "Allow new user registrations" set to yes it is hard to see what you have now.........

pawelfoto

Ok, It is solved

I just copied some scripts form modifyalb.php...

Joachim Müller

Post what you actually did for the benefit of others with similar questions.

pawelfoto

Ok, it is quite Simple.

Edit register.php file. Make sure you done backup first.


Find
<form method="post" action="{$_SERVER['PHP_SELF']}">

Past into new line before

<script>
var checkobj

function agreesubmit(el){
    checkobj=el
    if (document.all||document.getElementById){
        for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
            var tempobj=checkobj.form.elements[i]
            if(tempobj.type.toLowerCase()=="submit")
                tempobj.disabled=!checkobj.checked
        }
    }
}

function defaultagree(el){
    if (!document.all&&!document.getElementById){
        if (window.checkobj&&checkobj.checked)
            return true
        else{
            alert("I am sure")
            return false
        }
    }
}
</script>


Next find

echo <<<EOT
                </td>
        </tr>
        <tr>
                <td colspan="2" align="center" class="tablef">
                        <input type="submit" name="agree" value="{$lang_register_php['i_agree']}" class="button" />
                </td>
        </tr>

EOT;


and replace it with this code below

echo <<<EOT
 
                </td>
                 
        </tr>
        <tr>
        <td colspan="1" align="left" class="tablef">
               
                                      <input name="agreecheck" id="agreecheck" type="checkbox" onClick="agreesubmit(this)" /><label for="agreecheck"><b>I Agree</b></label>
                </td>

        </tr>
        <tr>
                <td colspan="1" align="center" class="tablef">
                        <input type="submit" name="agree" value="{$lang_register_php['i_agree']}" class="button" disabled="disabled" />
                </td>
        </tr>

EOT;


Thats it !

Joachim Müller