We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10450
    • 30 Posts
    Hey guys,

    I have weblogin coding in MODx i.e.

    <form method="post" name="loginfrm" action="[+action+]" style="margin: 0px; padding: 0px;">
    <input type="hidden" value="[+rememberme+]" name="rememberme" />
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><b>User:</b></td>
    <td><input type="text" name="username" tabindex="1" onkeypress="return webLoginEnter(document.loginfrm.password);" size="8" style="width: 150px;" value="[+username+]" /></td>
    </tr>
    <tr>
    <td><b>Password:</b></td>
    <td><input type="password" name="password" tabindex="2" onkeypress="return webLoginEnter(document.loginfrm.cmdweblogin);" style="width: 150px;" value="" /></td>
    </tr>
    <tr>
    <td><label for="chkbox" style="cursor:pointer">Remember me:&nbsp; </label></td>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td valign="top"><input type="checkbox" id="chkbox" name="chkbox" tabindex="4" size="1" value="" [+checkbox+] onclick="webLoginCheckRemember()" /></td>
    <td align="right">
    <input type="submit" value="[+logintext+]" name="cmdweblogin" /></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td colspan="2"><a href="#" onclick="webLoginShowForm(2);return false;">Forget Password?</a></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </form>
    <hr>
    <!-- log out hyperlink section -->
    <a href=’[+action+]’>[+logouttext+]</a>
    <hr>
    <!-- Password reminder form section -->
    <form name="loginreminder" method="post" action="[+action+]" style="margin: 0px; padding: 0px;">
    <input type="hidden" name="txtpwdrem" value="0" />
    <table border="0">
    <tr>
    <td>Enter the email address of your account
    below to receive your password:</td>
    </tr>
    <tr>
    <td><input type="text" name="txtwebemail" size="24" /></td>
    </tr>
    <tr>
    <td align="right"><input type="submit" value="Submit" name="cmdweblogin" />
    <input type="reset" value="Cancel" name="cmdcancel" onclick="webLoginShowForm(1);" /></td>
    </tr>
    </table>
    </form>
    <?php
    $t = ob_get_contents();
    ob_end_clean();
    return $t;





    What is [+action+] and what it does?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That’s a placeholder to specify the form processing URL, and its value is set to the current page in the weblogin.inc.php file
              $tpl = str_replace("[+action+]",preserveUrl($modx->documentIdentifier,"",$ref),$tpl);
      
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10450
        • 30 Posts
        I have username and password field. can anybody give me the proper sequence of code to validate this box , by using snippet and chunk.

        One more query-- how to include ".js" file in modx snippet
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Use the included WebLogin snippet; or install the WebLoginPE snippet. Why are you re-inventing the wheel?

          http://wiki.modxcms.com/index.php/API:regClientStartupScript
          http://wiki.modxcms.com/index.php/API:regClientScript
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 10450
            • 30 Posts
            Quote from: sottwell at Feb 04, 2010, 07:13 AM

            Use the included WebLogin snippet; or install the WebLoginPE snippet. Why are you re-inventing the wheel?

            http://wiki.modxcms.com/index.php/API:regClientStartupScript
            http://wiki.modxcms.com/index.php/API:regClientScript

            thanks

            I wanna insert js validation to username and password. The look and feel of username and password is very much different than modx login box.
              • 10450
              • 30 Posts
              I have this code in my site. I want to implement this code in MODX. so where to put .js file PLS help

              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
              <title>Dynamic Inline Form Validation Demo</title>
              <link rel="stylesheet" type="text/css" href="messages.css" />
              <script type="text/javascript" src="messages.js"></script>
              </head>
              <body>
              <div id="wrapper">
              <form name="form" id="form" class="form" action="success.html" onsubmit="return validate(this)" method="post">
              <label for="name">Full Name:</label>
              <input type="text" name="name" id="name" />
              <label for="password">Password:</label>
              <input type="text" name="password" id="password" />
              <input type="submit" value="Submit" class="submit" />
              </form>
              </div>
              </body>
              </html>

                • 10450
                • 30 Posts
                Quote from: ganesh_1707 at Feb 05, 2010, 03:02 AM

                I have following code in my site. I want to implement this code in MODX. so where to put .js file PLS help

                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml">
                <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <title>Dynamic Inline Form Validation Demo</title>
                <link rel="stylesheet" type="text/css" href="messages.css" />
                <script type="text/javascript" src="messages.js"></script>
                </head>
                <body>
                <div id="wrapper">
                <form name="form" id="form" class="form" action="success.html" onsubmit="return validate(this)" method="post">
                <label for="name">Full Name:</label>
                <input type="text" name="name" id="name" />
                <label for="password">Password:</label>
                <input type="text" name="password" id="password" />
                <input type="submit" value="Submit" class="submit" />
                </form>
                </div>
                </body>
                </html>





                Pls Pls help me.