I have the following method in my template file:
function submit_serials(){
var serials = $('serials').value;
new Ajax.Request("<?php echo $this->getUrl('*/*/process'); ?>" + '?serials=' + serials, {
method: 'POST',
onComplete: function(transport) {
div = $('feedback');
div.update(transport.responseText);
}
});
}
in my controller file I have:
public function processAction(){
$serials = $_POST['serials'];
...
}
I'm getting a Request-URI too large
error. I understand that there is too much info being stored in the serials variable, but how else can I parse this through to the controller? I read that you should be using the body of the AJAX request but I can't seem to figure out how to do so.
How can I parse the serials in the body of this Ajax request & fetch them from within the controller file?
Best Answer
You need form param serialize, and send form fields as it as param to ajax request
If you work with varien form stucture then using form ID you can create Varien form vaidation:
Here
min-mobile-login
is id form .Ex<form id="min-mobile-login" ...
.And form
button typ
e should besubmit
and it contentonclick
function and and return false