How can I echo the results of javascript function?
<SCRIPT language=JavaScript>
function optvalue()
{
var cardtype=ccard.card.options[ccard.card.options.selectedIndex].value;
return cardtype ;
}
</script>
<a href="test2.php?<?php echo 'card='; echo optvalue() ?>">Add to Card </a>
Inside the href I want to call the optvalue() function and return it so it shows the value selected from a drop-down list.
When I click the 'Add to Card' , it should pass 'card=VISA' via the url.
(VISA is one of the drop-down list options)