I have created newsletterpopup with two fields, 'email address' and 'subscriber's name'. And I have made input tag for this both field. So now I want to get the subscriber's name in a variable. How can I do that?
-
please mention where you need this valuesVaibhav Ahalpara– Vaibhav Ahalpara2016年11月25日 09:41:05 +00:00Commented Nov 25, 2016 at 9:41
2 Answers 2
If you want to get value in controller , You can use -
$data = $this->getRequest()->getPost();
$var = $data['input_field_name'];
Or if you want to get value in your template file than you can get it using following javascript code-
var inputValue = document.getElementById('input_field_id').value;
Probably you want to get input values in controller: You can use below code in your controller(which point your POST action):
$data = $this->getRequest()->getPost();
zend_debug::dump($data);