Jquery 在产品页面的弹出窗口中使用登录表单

Jquery 在产品页面的弹出窗口中使用登录表单,jquery,magento,customer,Jquery,Magento,Customer,我正在使用产品视图页面上的登录表单div处理弹出窗口 表格代码 <form action="<?php echo $custmlogin->getPostActionUrl() //echo $this->getPostActionUrl() ?>" method="post" id="login-form"> <?php //$this->getBlockHtml('formkey'); ?> <input name

我正在使用产品视图页面上的登录表单div处理弹出窗口

表格代码

<form action="<?php echo $custmlogin->getPostActionUrl() //echo $this->getPostActionUrl() ?>" method="post" id="login-form">
    <?php  //$this->getBlockHtml('formkey'); ?>
    <input name="form_key" type="hidden" value="<?php  echo Mage::getSingleton('core/session')->getFormKey() ?>" />
    <div class="account-login"  >
    <div class="row">

        <div class="col-sm-6 registered-users">
            <div class="content">
                <h2><?php echo $this->__('Registered Customers') ?></h2>
                <p><?php echo $this->__('If you have an account with us, please log in.') ?></p>
                <ul class="form-list">
                    <li>
                        <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
                        <div class="input-box">
                            <input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
                        </div>
                    </li>
                    <li>
                        <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
                        <div class="input-box">
                            <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
                        </div>
                    </li>
                    <?php echo $this->getChildHtml('form.additional.info'); ?>
                    <?php echo $this->getChildHtml('persistent.remember.me'); ?>
                </ul>
                <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
                <p class="required"><?php echo $this->__('* Required Fields') ?></p>
            </div>
            <div class="buttons-set">
                <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
                <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
            </div>
        </div>
    </div>
    </div>
    <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
        <input name="context" type="hidden" value="checkout" />
    <?php endif; ?>
</form>

我已经检查了您的代码,我可以看到弹出窗口中显示了帐户登录div,因此请使用帐户登录div下面的表单标签。
然后表单标签将显示在弹出窗口中,如下代码所示:

<div class="account-login"  >
<form action="<?php echo $custmlogin->getPostActionUrl() //echo $this->getPostActionUrl() ?>" method="post" id="login-form">
<?php  //$this->getBlockHtml('formkey'); ?>
<input name="form_key" type="hidden" value="<?php  echo Mage::getSingleton('core/session')->getFormKey() ?>" />
<div class="row">

    <div class="col-sm-6 registered-users">
        <div class="content">
            <h2><?php echo $this->__('Registered Customers') ?></h2>
            <p><?php echo $this->__('If you have an account with us, please log in.') ?></p>
            <ul class="form-list">
                <li>
                    <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
                    <div class="input-box">
                        <input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
                    </div>
                </li>
                <li>
                    <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
                    <div class="input-box">
                        <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
                    </div>
                </li>
                <?php echo $this->getChildHtml('form.additional.info'); ?>
                <?php echo $this->getChildHtml('persistent.remember.me'); ?>
            </ul>
            <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
            <p class="required"><?php echo $this->__('* Required Fields') ?></p>
        </div>
        <div class="buttons-set">
            <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
            <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
        </div>
    </div>
</div>
<?php if (Mage::helper('checkout')->isContextCheckout()): ?>
    <input name="context" type="hidden" value="checkout" />
<?php endif; ?>


在您的代码中,帐户登录div显示在弹出窗口中,请使用帐户登录div下面的表单标记,它将显示在您的弹出窗口中,如下面的代码所示:

<div class="account-login" >

<form action="<?php echo $custmlogin->getPostActionUrl() //echo $this->getPostActionUrl() ?>" method="post" id="login-form">
<?php  //$this->getBlockHtml('formkey'); ?>
<input name="form_key" type="hidden" value="<?php  echo Mage::getSingleton('core/session')->getFormKey() ?>" />
<div class="row">

    <div class<span class="pun" style="margin: 0px; padding: 0px; border:


我在表单中使用表单,所以我更改了文件中代码的位置,并使用基本url更改了表单操作路径

<div class="account-login"  >
<form action="<?php echo $custmlogin->getPostActionUrl() //echo $this->getPostActionUrl() ?>" method="post" id="login-form">
<?php  //$this->getBlockHtml('formkey'); ?>
<input name="form_key" type="hidden" value="<?php  echo Mage::getSingleton('core/session')->getFormKey() ?>" />
<div class="row">

    <div class="col-sm-6 registered-users">
        <div class="content">
            <h2><?php echo $this->__('Registered Customers') ?></h2>
            <p><?php echo $this->__('If you have an account with us, please log in.') ?></p>
            <ul class="form-list">
                <li>
                    <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
                    <div class="input-box">
                        <input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
                    </div>
                </li>
                <li>
                    <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
                    <div class="input-box">
                        <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
                    </div>
                </li>
                <?php echo $this->getChildHtml('form.additional.info'); ?>
                <?php echo $this->getChildHtml('persistent.remember.me'); ?>
            </ul>
            <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
            <p class="required"><?php echo $this->__('* Required Fields') ?></p>
        </div>
        <div class="buttons-set">
            <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
            <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
        </div>
    </div>
</div>
<?php if (Mage::helper('checkout')->isContextCheckout()): ?>
    <input name="context" type="hidden" value="checkout" />
<?php endif; ?>
<div class="account-login" >

<form action="<?php echo $custmlogin->getPostActionUrl() //echo $this->getPostActionUrl() ?>" method="post" id="login-form">
<?php  //$this->getBlockHtml('formkey'); ?>
<input name="form_key" type="hidden" value="<?php  echo Mage::getSingleton('core/session')->getFormKey() ?>" />
<div class="row">

    <div class<span class="pun" style="margin: 0px; padding: 0px; border: