[eluser]zorka[/eluser]
Hello,
I have a standard login page with a standard FORGOT PASSWORD option. I am poping up a FACEBOX when people click on FORGOT PASSWORD. QUESTION: I want to do standard validation in the facebox as I would in a "regular" browser window. The facebox loads, but as soon as I hit submit, the form loads again in a non-facebox window (the correct error shows, but it's in a regular browser window, not a facebox!). How do I keep facebox "lit" after submit?
Code:
<head>
[removed]
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loading_image : 'loading.gif',
close_image : 'closelabel.gif'
})
})
$.facebox.settings.opacity = 0.35;
[removed]
</head>
...
<a href="/login/password" rel="facebox">I forgot my password</a>
----
the function /login/password (function:password in controller:login) loads the FORGOT PASSWORD VIEW:
Code:
function password() {
$rules['email'] = "trim|required|valid_email|callback__password_check";
$this->validation->set_rules($rules);
if ($this->validation->run() == FALSE)
{
$data['title'] = 'Deals On Meals: Login';
$this->load->view('login/password_form');
}
else
{
$this->sendpassword();
}
}
FORGOT PASSWORD VIEW:
Code:
<?php echo form_open('login/password'); ?>
<table id="popupLayout" style="border-collapse:separate;" cellspacing="5" align="center">
<tr>
<td class="formheader" colspan="2">Please enter your email address</td>
</tr>
<tr><td colspan="2"><?php echo $this->validation->error_string; ?></td>
</tr>
<tr>
<td height="33">Email</td>
<td><input type="text" name="email" id="email"></td>
</tr>
<tr>
<td> </td>
<td><input class="login" type="submit" name="submit" value="Submit" />
<input class="close"></td>
</tr>
<tr>
<td colspan="2" id="surveycodemessage"></td>
</tr>
</table>
<?php form_close(); ?>