views:

900

answers:

1

Hi friends,

I m using mootools 1.1 for developing joomla component.

i want to get the form posted data in onComplete block.

i don't want to set the post data in response.

Is it possible? if yes then please reply how can i do that?

Thanks in advance.

A: 

You can get it via "this.options.data".

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.11/mootools.js"&gt;&lt;/script&gt;

<script type="text/javascript">
    window.addEvent('domready', function() {
        new Ajax("test.php", {
            method: 'post',
            data: {field1:"value1", field2:"value2"},
            onComplete: function(text) {
                this.options.data;  // here is your data
            }
        }).request();
    });
</script>
Lance Rushing
i want to get form post data. which is posted using ajax.
Avinash
Yes, your post data is stored in this.options.data. To test, if you have firebug/console run a console.dir(this.options.data) inside of onComplete function to see what I mean.
Lance Rushing
ok thanks got it..Thanks a lot....
Avinash