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

  • SEARCH
  • Home
  • 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 6335005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:46:12+00:00 2026-05-24T18:46:12+00:00

My homepage has 2 different forms on it one for registering the user and

  • 0

My homepage has 2 different forms on it one for registering the user and one for the login. Both forms point to the same model but to different actions. The problem is that if you submit either form it will set off the action on the other form as well, so if I’m trying to login it will set off the registration action in the controller as if I was trying to register, for instance.

I already checked this solution but it seems overly complicated for something so simple, not to mention it will clutter my models folder with extra models that are pretty much useless except for a single action.

EDIT: I do not have this part of my project under Auth, I have admin routing and an admin section setup under Auth, but on the non-admin parts I’m using my own session handling and user validation.

Here is the code for my forms as well:

This is the registration form:

echo $this->Form->create('Fonyker', array('action' => 'add'));
            echo $this->Form->input('username', array(
                'div' => array(
                    'class' => 'span-8'
                ),
                'class' => 'input-text long',
                'id' => 'FonykerUsernameRegister',
                'label' => array(
                    'class' => 'inlined',
                    'text' => ''
                ),
                'placeholder' => 'Username',
                'onsubmit' => 'return false;'
            ));
            echo $this->Form->input('email', array(
                'div' => array(
                    'class' => 'span-8'
                ),
                'class' => 'input-text long',
                'label' => array(
                    'class' => 'inlined',
                    'text' => ''
                ),
                'placeholder' => 'Email',
                'onsubmit' => 'return false;'
            ));
            echo $this->Form->input('password', array(
                'div' => array(
                    'class' => 'span-8'
                ),
                'class' => 'input-text long',
                'id' => 'FonykerPasswordRegister',
                'label' => array(
                    'class' => 'inlined',
                    'text' => ''
                ),
                'placeholder' => 'Password',
                'onsubmit' => 'return false;'
            ));
            echo $this->Form->input('name', array(
                'div' => array(
                    'class' => 'span-8'
                ),
                'class' => 'input-text long',
                'label' => array(
                    'class' => 'inlined',
                    'text' => ''
                ),
                'placeholder' => 'Name',
                'onsubmit' => 'return false;'
            ));
        ?>
        <div class="span-8 required">
            <label for="FonykerBirthdate" class="inlined">From</label>
            <input id="FonykerBirthdate" type="text" onsubmit="return false;" placeholder="Birthdate" name="data[Fonyker][birthdate]" class="datepicker input-text long" enabled="false">
        </div>
        <?php

            $options = array('M' => 'M', 'F' => 'F');
            $attributes = array(
                'empty' => 'Gender',
                'class' => 'input-combo span-8'
            );

            echo $this->Form->select('gender', $options, NULL, $attributes);

            echo $this->Form->submit('',array(
                'class' => 'signup-button', 
                'id' => 'signup-button'
            ));

            echo $this->Form->end();
        ?>

And the login form:

echo $this->Form->create('Fonyker', array('action' => 'login'));
                    echo $this->Form->input('username', array(
                        'div' => array(
                            'class' => 'span-3'
                        ),
                        'class' => 'input-text short',
                        'id' => 'FonykerUsernameLogin',
                        'label' => array(
                            'class' => 'inlined',
                            'text' => ''
                        ),
                        'placeholder' => 'Username'
                    ));
                    echo $this->Form->input('password', array(
                        'div' => array(
                            'class' => 'span-3',
                        ),
                        'class' => 'input-text short',
                        'id' => 'FonykerPasswordLogin',
                        'label' => array(
                            'class' => 'inlined',
                            'text' => ''
                        ),
                        'placeholder' => 'Password'
                    ));

                    echo $this->Form->submit('',array(
                        'div' => array(
                            'class' => 'span-1'
                        ),
                        'class' => 'login-button', 
                    ));

                    echo $this->Form->input('Fonyker.remember', array(
                        'div' => array(
                            'class' => 'span-3',
                        ),
                        'type' => 'checkbox', 
                        'label' => array(
                            'text' => 'Remember me',
                            'style' => 'margin-left:-10px;'
                        ), 
                        'value' => 'yes',
                        'class' => 'span-1'
                    ));

                    echo $this->Html->link(__("Forgot it?", TRUE), array('controller' => "pages", 'action' => "recover_password" ), array('class' => 'span-2'));

                    echo $this->Form->end();
                ?>
  • 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-05-24T18:46:13+00:00Added an answer on May 24, 2026 at 6:46 pm

    The problem in the end was simply due to the naming of my forms, you have to make sure the names of both the forms and fields to not overlap if they are from the same controller, and be sure to end the forms properly.

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

Sidebar

Related Questions

I'm trying to design a homepage for an MVC site that has two different
I'm building a website with a homepage that has a different article everyday. I
On my homepage I got: <ul id=login> <li> <a id=loginswitch href=./login-page>log-in</a> | </li> <li>
I have a homepage.html and it refers to styles.css(makes a table). But I also
I just set up my new homepage at http://ritter.vg . I'm using jQuery, but
I have user control under Sitecore CMS. It has some controls bound to some
I've created a new content type called Homepage, which has a number of fields.
I am implementing a clients website in wordpress that has both news and blog
I have a jquerymobile site. One of the pages has a search box with
I know there has to be a simple answer to this, but Google's not

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.