On 05/03/2008, vtsuper <[EMAIL PROTECTED]> wrote:
>
>  There are 2 classes FormExt, AjaxRequest
>  I create a FormExt object and when the user submit the form, then I
>  will call another AjaxRequest Object
>  When the AjaxRequest finish the process, then it will trigger
>  onComplete
>
>  I would like the onComplete method will call the FormExt.reset()
>  so hwo to do this?
>  I must pass the FormExt obj to the AjaxRequest??? and other method???
>
>  var FormExt = Class.create({
>     initialize: function(id){
>         this.id=id;
>         this.obj=$(this.id);
>         this.ajaxObj='';
>
>         this.eventSubmit=this.submit.bindAsEventListener(this);
>         Event.observe(this.id, 'submit', this.eventSubmit);
>     },
>
>     submit:function(e){
>         this.ajaxObj=new AjaxForm(this.id);
>         this.ajaxObj.startAjax();
>         break;
>     },
>
>     reset:function(){
>         this.obj.reset();
>     }
>  });
>
>  var AjaxRequest = Class.create({
>     initialize: function(id){
>         this.frmObj=$(id);
>         this.ajaxObj='';
>     },
>
>     startAjax: function(){
>         this.ajaxObj = new Ajax.Request(
>             'abc.php',{
>                 onComplete:this.onComplete.bind(this)
>             }
>         );
>     }
>
>     onComplete:function(){
>         alert('complete now');
>     }
>  });

var AjaxRequest = Class.create
        ({
        initialize: function(id)
                {
                this.frmObj=$(id);
                this.ajaxObj='';
                },

        startAjax: function()
                {
                this.ajaxObj = new Ajax.Request
                        (
                        'abc.php',
                        {
                        onComplete:function()
                                {
                                alert('complete now');
                                this.formObj.reset();
                                }
                        }
                }
        });

maybe.

Sorry for the reform. Makes it easier for me to read.

Basically added

this.formObj.reset();

to the onComplete function.
-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to