Ajax registration form
Permalink
I want to implement an ajax registration form. I call the do_register method of the register class and set the dataType: 'json' in the javascript:
There is also a block in the register class, which checks for the request type and returns a JSON array:
However, the ajax call doesn't return anything. If I don't specify a dataType, the ajax call returns the whole registration page and I don't want that. I only want the $registerData array in json form. Is that possible?
var data = $('form#registration-form').serialize(); $.post( '<?php echo $this->url('/register', 'do_register')?>', function(data) { alert(data); }, 'json' );
There is also a block in the register class, which checks for the request type and returns a JSON array:
However, the ajax call doesn't return anything. If I don't specify a dataType, the ajax call returns the whole registration page and I don't want that. I only want the $registerData array in json form. Is that possible?
Use