Yii Framework Forum: How To Call Ajax - Yii Framework Forum

Jump to content

  • (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

How To Call Ajax Rate Topic: *---- 1 Votes

#61 User is offline   Devendra411 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-April 13
  • Location:Bangalore

Posted 22 May 2013 - 02:13 AM

My error page is showing in new page, but my error page also need to show in same page. pls help me.
0

#62 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 03:10 AM

u can chanage the form action and try
Thanks,
Ankit Modi
Skype : amodi06
0

#63 User is offline   Devendra411 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-April 13
  • Location:Bangalore

Posted 22 May 2013 - 03:28 AM

I modified in controller but now also the error page is displaying in new page.
0

#64 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 04:15 AM

hi,

can u send the all project and db otherwise give me a live URL? so i undertstand.
Thanks,
Ankit Modi
Skype : amodi06
0

#65 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 04:26 AM

ok but right now i am in my office so i don't have access of skype and any other websites.
Thanks,
Ankit Modi
Skype : amodi06
0

#66 User is offline   Devendra411 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-April 13
  • Location:Bangalore

Posted 22 May 2013 - 04:42 AM

Dear sir, by using onclick how to say fill all fields when click submit button,
0

#67 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 05:02 AM

First change the line on password.php

<?php echo CHtml::link('Link Text',array('user/password?id=942'),array('class'=>'aa','onclick'=>'test()')); ?>




and add the function

<script>
function change(id) {
            if (id != '') {
                $.ajax({
                    type: "GET",
                    url: "<?php echo Controller::createUrl('/users/password') ?>",
                    data: {"id": id},
                    async: false,
                    success: function(data) {
                        $('.inner_tab_contant').html(data);
                    },
               });
            }
        }
</script>

Thanks,
Ankit Modi
Skype : amodi06
0

#68 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 05:22 AM

u can call ajax or not on Password link?
Thanks,
Ankit Modi
Skype : amodi06
0

#69 User is offline   Devendra411 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-April 13
  • Location:Bangalore

Posted 22 May 2013 - 06:20 AM

Can i know if i put below lines my link(action) is not working on my password page

clientOptions' => array(
'validateOnSubmit' => true,

),

'htmlOptions' => array(
'onsubmit' => "return false;",
),
0

#70 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 06:50 AM

u can try the below code call a aftervalidate method on submit botton

 'clientOptions' => array(
                            'validateOnSubmit' => true,
                            'afterValidate' => 'js:checkErrors'
                    ),


<script>
                function checkErrors(form, data, hasError) {
                    var data=$("#pass-from").serialize();
                    if(hasError!=true){
                        $.ajax({
                            type: 'POST',
                            url: '<?php echo Yii::app()->createAbsoluteUrl("user/password?id=" . $_GET['vid']); ?>',
                            data:data,
                            asyc:false,
                            success:function(data){
                               alert(data)

                            }

                        });
                    }
                }

</script>

Thanks,
Ankit Modi
Skype : amodi06
0

#71 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 10:31 PM

Hi

havu u done this job?
Thanks,
Ankit Modi
Skype : amodi06
0

#72 User is offline   Devendra411 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-April 13
  • Location:Bangalore

Posted 22 May 2013 - 10:49 PM

View PostAnkit Modi, on 22 May 2013 - 10:31 PM, said:

Hi

havu u done this job?

No, sir, stiil my error page is showing in new page..i'm not understanding how to solve this?
0

#73 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 19-February 13
  • Location:India

Posted 22 May 2013 - 11:11 PM

can u give me live URL?
Thanks,
Ankit Modi
Skype : amodi06
0

#74 User is offline   Devendra411 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-April 13
  • Location:Bangalore

Posted 27 May 2013 - 02:57 AM

Hi, my setting page is divided into two parts. When i click change password it displaying new page also in current page. Like that, i need the error message also in my current page. Now i'm getting the error page in new tab. pls help me.

Attached File(s)


0

Share this topic:


  • (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users