I have a custom module for generate random keys. The concept is when admin clicks the add new button it will automatically creates the random codes, at the time of editing i have removed all buttons and added extra field button to send mail. Upto this i have no problem, but at the time of clicking send mail button i am facing problem,
I have written some scripts for onclick event, Edit/Tab/Form.php:
$fieldset->addField('promo_email', 'text', array(
'label' => Mage::helper('promogenerator')->__('Send Mail'),
'name' => 'promo_email',
'after_element_html' => '<button type="button" onclick="sendmail()">Send Mail</button>'
));
I have written the scripts at, Edit.php:
$this->_formScripts[] = "
function sendmail(){
var email = jQuery('#promo_email').val(),
code = jQuery('#promocode').val();
window.location.href = '{$this->getUrl(`*/*/send`, array(`id` => $this->getRequest()->getParam(`id`)))}';
}
";
the problem is in url, the script function not redirect me to the send url, it redirects me to the index page.
I really don't know how to give the url in scripts. Can someone point me the correct solution.