Desired Logic
I would like my template to dispatch an event every time the user clicks the
on and off buttons.
My view.phtml file look likes this...
/*Some Html*/
<?php
/*=== Variables ===========*/
$customer = Mage::getModel('customer/session')->getCustomer();
/*$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();*/
$groupId = $customer->getGroupId();
$group = Mage::getModel('customer/group')->load($groupId);
$groupCode = $group->getCode();
$OnArray = array(
"value" => "on",
"customer" => $customer
);
$OffArray = array(
"value" => "off",
"customer" => $customer
);
?>
/* More HTML * /
<form action="">
<input type="radio" name="auto-refill" value="On" onClick = "<?php Mage: dispatchEvent('autoFill_Update', $OnArray ?>" />On<br>
<input type="radio" name="auto-refill" value="Off" onClick = "<?php Mage: dispatchEvent('autoFill_Update', $OffArray ?>" />Off
</form>
Questions
Did I implement the desired logic correctly ?
Since the php scripts are separated my html code do I lose the
reference to the ON and OFF arrays when I try to pass them in onClick ?
Any guidance is truly appreciated