MoroGasper / yii-usergroups

Automatically exported from code.google.com/p/yii-usergroups
0 stars 0 forks source link

in ajax request redirecting new page in login, when it fails, because of submit button #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. loding login view via ajax
2. using wrong credentials
3. submitting form

What is the expected output? What do you see instead?
the page should not redirected, or should redirect to login page with render, 
not render partial

What version of the product are you using? On what operating system?
UserGroups 1.8

Please provide any additional information below.
normal submit button(not ajax), will redirect page to somewhere.
using it in login form, with wrong credentials and this logic:

// display the login form
if (Yii::app()->request->isAjaxRequest || isset($_GET['_isAjax']))
    $this->renderPartial('/user/login',array('model'=>$model));
else
    $this->render('/user/login',array('model'=>$model));

will cause a new page rendered with renderPartial.
maybe using ajaxSubmitButton in ajax mod will solve the problem, or ofter 
validation fails, render the layouted page 

Original issue reported on code.google.com by APajooha...@gmail.com on 12 Sep 2011 at 5:54