WordPress.org

Ready to get started?Download WordPress

Forums

Does anyone know how to do a simple login hack? (1 post)

  1. andytford
    Member
    Posted 5 years ago #

    I am using the Ajax Login Widget and have what would seem like a simple dilemma. I simply need to add a 'Agree to Terms' checkbox above the login form and have it validate when the user logs in.

    This code is specific to the Ajax Login Widget, but I assume the correction to make it work would be universal:

    In alw_template.js, I added the checkbox inside the <form> tag with the following code:

    <input type=checkbox name=”agree” value=”yes”>I agree to terms and conditions

    In ajax-login-widget.js, I need to add (got this from a Google search on checkbox validation):

    <script language="JavaScript" type="text/JavaScript">
    <!--//hide script
    function checkme() {
    missinginfo = "";
    if (!document.form.agree.checked) {
    missinginfo += "\n - You must agree to the terms";
    }
    if (missinginfo != "") {
    missinginfo ="__________________________________\n" +
    "Required information is missing: \n" +
    missinginfo + "\n__________________________________" +
    "\nPlease complete and resubmit.";
    alert(missinginfo);
    return false;
    }
    else {
    return true;
    }
    }
    // --->
    </script>

    I assume I need to adjust this to remove function checkme() and add in into function alw_login() ?

    What do I need to adjust in order to make this work?

    Thanks to anyone who takes the time to look at this,

    Andy

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.