Login In Modal.

Guys

when I click on login button or sign in button. a modal appears and when someone enters email and password and click on sign in , it closes the modal.

i want that the modal doesnot close and the error appears on the modal dialog.

<div class="modal-body">

                                &#60;&#33;-- Sign In Form --&#62;


                                &#60;&#33;--/* @var &#036;model User/validated via CUserIdentity */


                                /* @var &#036;form CActiveForm */--&#62;


                                &#60;&#33;-- Text input--&#62;


                                &lt;?php echo CHtml::beginForm(array('class'=&gt;'form-horizontal')); ?&gt;


                                &lt;div class=&quot;form-group&quot;&gt;





                                           


                                           &lt;?php echo CHtml::errorSummary(&#036;model); ?&gt;





                                             &lt;div class=&quot;control-group&quot;&gt;


                                                  &lt;label class=&quot;control-label&quot; for=&quot;Email&quot;&gt;Email:&lt;/label&gt;


                                                  &lt;div class=&quot;controls&quot;&gt;


                                                    &lt;?php echo CHtml::activeTextField(&#036;model,'Email',array('class'=&gt;'form-control','id'=&gt;'Email','placeholder'=&gt;'yourname@email.com')) ?&gt;


                                                   &lt;/div&gt;


                                             &lt;/div&gt;





                                              &#60;&#33;-- Password input--&#62;


                                              &lt;div class=&quot;control-group&quot;&gt;


                                               &lt;label class=&quot;control-label&quot; for=&quot;password&quot;&gt;Password:&lt;/label&gt;


                                                &lt;div class=&quot;controls&quot;&gt;


                                                  &lt;?php echo CHtml::activePasswordField(&#036;model,'password',array('class'=&gt;'form-control','id'=&gt;'password','type'=&gt;'password' ,'class'=&gt;'input-large','placeholder'=&gt;'********')) ?&gt;


                                                &lt;/div&gt;&#60;&#33;--controls--&#62;


                                              &lt;/div&gt;&#60;&#33;--control-group--&#62;





                                              &#60;&#33;-- Remember me --&#62;


                                              &lt;div class=&quot;control-group&quot;&gt;


                                               &lt;label class=&quot;checkbox inline&quot; for=&quot;rememberme-0&quot;&gt;Remember me


                                                  &lt;?php echo CHtml::activeCheckBox(&#036;model,'rememberMe',array('type'=&gt;'checkbox','name'=&gt;'Rememberme','id'=&gt;'rememberme-0','value'=&gt;'Remember me')); ?&gt;


                                               &lt;/label&gt;


                                               


                                              &lt;/div&gt;&#60;&#33;--control-group--&#62;





                                               &#60;&#33;-- Sign in button --&#62;


                                              &lt;div class=&quot;control-group&quot;&gt;


                                                &lt;label class=&quot;control-label&quot; for=&quot;signin&quot;&gt;&lt;/label&gt;


                                                &lt;div class=&quot;controls&quot;&gt;


                                                  &lt;?php echo CHtml::submitButton('Login',array('id'=&gt;'Signin','name'=&gt;'signin', 'class'=&gt;'btn btn-success')); ?&gt;


                                                &lt;/div&gt;&#60;&#33;--controls--&#62;


                                              &lt;/div&gt;&#60;&#33;--control-group--&#62;


                                








                                &lt;/div&gt;


                                &lt;?php echo CHtml::endForm(); ?&gt;

I think you need to change the submitButton to ajaxsubmit button or normal button with ajax function.

so you mean , shall I replace the button code with the following?

CHtml::ajaxSubmitButton(

 'the button label',


 'the URL for the AJAX request',


 'AJAX options',


 array('id' =&gt; 'desiredId') // HTML options for the button.


 );

Yes.You can refer ajaxSubmitButton-detail