Welcome Guest, Not a member yet? Register   Sign In
multiple controllers with forms cross submitting
#1

[eluser]USCTrojans[/eluser]
I've got an interesting thing going on right now and can not figure out how to fix it. I am using HMVC modular controllers and am trying to use a controller for a login function and one for a create profile function. I have verified that they both work and validate etc when apart, but for some reseason when I load them both as modules onto one page the bottom function pulls the results of the top function when I click submit.

I have tried renaming the submit button and am using code igniter form class but still can not figure out what is causing this.

here's my homepage controller

Code:
function index()
{
  $this->load->view('pagination/header');
  $this->load->module('login/login');
  $this->login->index();
  $this->load->module('create_profile/create_profile');
  $this->create_profile->create();
  $this->load->view('pagination/footer');
}

I have validated that both the create_profile controller and login controller work on this page when isolated but when together they cause problems.

I'm guessing it has to do with the form submit buttons but am not sure. I even tried changing one button to a reset button but did not work either.

Thanks for any help
#2

[eluser]vbsaltydog[/eluser]
Paste the source code from the browser.
#3

[eluser]USCTrojans[/eluser]
Code:
<div id="login_form">

<h1>Wordlife Login </h1>

&lt;form action="http://localhost:8888/index.php/login/local_validate_Login" method="post" accept-charset="utf-8"&gt;&lt;input type="text" name="email_address" value="Email Address"  />&lt;input type="password" name="password" value="Password"  /&gt;&lt;input type="reset" name="login_reset" value="Login"  />
</div>
<div id="create_profile_form" class="homepage_forms">

<h2>Create Your Own Wordlife Account </h2>

&lt;form action="http://localhost:8888/index.php/create_profile/create_profile_validation" method="post" accept-charset="utf-8"&gt;&lt;input type="text" name="create_first_name" value="First Name"  />&lt;input type="text" name="create_last_name" value="Last Name"  /&gt;&lt;input type="text" name="create_email_address" value="Email Address"  />&lt;input type="password" name="create_password" value="Password"  /&gt;&lt;input type="password" name="create_password_confirm" value="Password Confirm"  />&lt;input type="submit" name="profile_create_submit" value="Create Profile"  /&gt;
</div>

it says the action is localhost:8888/index.ph/create_profile/create_profile_valdation but it submits the information to the form at the top with action:http://localhost:8888/index.php/login/local_validate_Login

thanks
#4

[eluser]CroNiX[/eluser]
It's against HTML standards to have nested forms.
#5

[eluser]USCTrojans[/eluser]
that makes perfect sense. I didn't realize that code igniter did not automatically close the form so it was just a matter of adding an echo form_close() and it works great...thanks




Theme © iAndrew 2016 - Forum software by © MyBB