Hey guys,
I searched around the forum a bit and couldn't find anything that helped.
Here's the scenario:
I have a page that has a form on it that contains checkboxes that represent a product ID. When the user selects checkboxes and clicks a button the IDs are submitted to a database.
This is easy to do but my question is this:
Can you do this using a combination of javascript and php so you don't have to reload the page?
I got this to work (which on second thought really doesn't get me any closer to a solution, other than showing I can stick php in javascript):
<html>
<head>
<script language="javascript">
function describe()
{
document.getElementById("test").innerHTML = '<?php echo "test";?>';
}
</script>
</head>
<body>
<a href="#" onClick="describe()">Test</a>
<div id="test">
<br/>
</div>
</body>
</html>
but if I put in code to query a database in the javascript that would be quite a security liability. I don't need to do it this way, and probably won't, but I was just curious if there was a way. Any input is appreciated.
Thanks
Steve