<script language="javascript">
function customFunction(url){
alert(url);
//window.location = "url";
//document.all.url.checked = true;
document.getElementById('url').checked = true;
document.downloadable_prod.submit();
}
</script>
<!-- Note : this below radio buttons coming from loop --->
<input type="radio" name="links" id="links_<?php echo $_link->getId() ?>" value="<?php echo $_link->getId() ?>" />
<a href="javascript:customFunction(<?php echo $_link->getId() ?>);" class="buy_stan">
<span style="margin-left:160px;">
<?php echo $this->getFormattedLinkPrice($_link); ?>
答案 0 :(得分:0)
你的单选按钮有一个链接“links_xxxx”,xxx就是你的php返回的内容。在您的锚标记中,您需要添加自定义函数调用的链接。试试下面的
注意我在customFunction之后添加了'links_(并在你的php调用结束时使用'关闭它。
<a href="javascript:customFunction('links_<?php echo $_link->getId() ?>');" class="buy_stan">