how to submit a form through anchor tag such that radio button is also selected?
<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 loo开发者_高级运维p --->
<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); ?>
your radio buttons have a link of "links_xxxx", xxx being whatever your php is returning. in your anchor tag you need to add links to the custom function call. Try the below
Note I added 'links_ after customFunction( and closed it off using ' at the end of your php call.
<a href="javascript:customFunction('links_<?php echo $_link->getId() ?>');" class="buy_stan">
精彩评论