Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7925185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:10:41+00:00 2026-06-03T18:10:41+00:00

I am modifying my login/registration form via login.phtml and have a problem with the

  • 0

I am modifying my login/registration form via login.phtml and have a problem with the “Create Account” button when I use an image button instead of the standard css button.

I modified this original code

               <button type="button" title="<?php echo $this->__('Create an Account') ?>" class="button" onclick="window.location='<?php echo Mage::helper('persistent')->getCreateAccountUrl($this->getCreateAccountUrl()) ?>';"><span><span><?php echo $this->__('Create an Account') ?></span></span></button>

to

  <input type="image" src="http://localhost/magento/skin/frontend/default/mytemplate/images/button-createaccount.png" title="<?php echo $this->__('Create an Account') ?>"  onclick="window.location='<?php echo Mage::helper('persistent')->getCreateAccountUrl($this->getCreateAccountUrl()) ?>';">

and moved the button into the “content” div of the right floating “create account” div. The button is display correctly but everytime when I click create account, my browser highlights the obligatory fields of the login form in the left floating “Login” div before continuing to the create account page.

When I click the original css create account button, on the lower part of the page (within another div, which is neither part of the login nor create account div) the browser continues correctly without highlighting the form fields first. Has this somehow to do with the position of the button within the div or with the window.location method???

Here’s the complete code:

<div class="account-login"> <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
  <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
    <div class="col2-set">
    <div class="col-2 new-users">
      <div class="content"> <?php echo $this->__('New Customers') ?>
        <p><?php echo $this->__('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?></p>
        <!-- Insert image button for Create Account in new div class "button" -->
        <div class="button">
          <input type="image" src="http://localhost/magento/skin/frontend/default/mytemplate/images/button-createaccount.png" title="<?php echo $this->__('Create an Account') ?>"  onclick="window.location='<?php echo Mage::helper('persistent')->getCreateAccountUrl($this->getCreateAccountUrl()) ?>';">
        </div>
        <!-- End Insert image button for Create Account in new div class "button"  --> 
      </div>
    </div>
    <div class="col-1 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->htmlEscape($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('persistent.remember.me'); ?>
        </ul>
        <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?> 
        <!-- Insert image button for Login in div class "button" -->
        <div class="button">
          <input type="image" src="http://localhost/magento/skin/frontend/default/mytemplate/images/button-login.png" title="<?php echo $this->__('Login') ?>" name="send" id="send2">
        </div>
        <!-- End Insert image button for Login in div class "button" -->
        <div class="buttons-set"> <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a> </div>
      </div>
    </div>
    <div class="col2-set">
      <div class="col-2 new-users">
        <div class="buttons-set">
          <button type="button" title="<?php echo $this->__('Create an Account') ?>" class="button" onclick="window.location='<?php echo Mage::helper('persistent')->getCreateAccountUrl($this->getCreateAccountUrl()) ?>';"><span><span><?php echo $this->__('Create an Account') ?></span></span></button>
        </div>
      </div>
      <div class="col-1 registered-users">
        <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; ?>
  </form>
  <script type="text/javascript">
               var dataForm = new VarienForm('login-form', true);
    </script> 
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:10:42+00:00Added an answer on June 3, 2026 at 6:10 pm

    You are having his issue because the form is initiated in javascript as a Varien_Form:

    <script type="text/javascript">
        var dataForm = new VarienForm('login-form', true);
    </script>
    

    This has a number of default behaviours which are obviously behaing strangely when it encounters buttons and elements it is not expecting. These are defined somewhere in Magento’s js libraries.

    Hope this helps point you in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am modifying a php login form, adding javascript check form function to it.
In my web app, I am using form-based login. I have a scenario where
I have set up the UserBundle and everything works fine. Now, instead of modifying
I found a way to customize devise to use username to login instead of
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I
I am modifying a Nant build script to run some unit tests. I have
I use software called DotNetPanel (DNP) and I'm modifying PHProxy to automatically log into
I'm modifying a Winforms app to use connection pooling so data access can occur
I have just begun experimenting with the DotNetOpenAuth project. Modifying the sample OpenIdRelyingPartyMvc project,
I am having trouble with modifying a php application to have pagination. My error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.