Horus_Kol
11-04-2003, 06:54 AM
Can it be done?
look at this code:
<?php
if (isset($_POST['test_btn']))
echo $_POST['test_btn'];
?>
<head>
<script type='text/javascript'>
function sub(btn)
{
test_div.innerHTML = "<input type='hidden' name='test_btn' value='7'>";
forms[0].submit();
}
</script>
</head>
<body>
<form action='test.php' method='post'>
<div id='test_div'></div>
<button type='button' name='btn1' onClick='sub(1)'>Button 1</button>
<button type='button' name='btn2' onClick='sub(2)'>Button 2</button>
</form>
</body>
I'm getting a Javascript error, but not sure why.
any Client Sider's out there with an idea?
Cheers,
HK
look at this code:
<?php
if (isset($_POST['test_btn']))
echo $_POST['test_btn'];
?>
<head>
<script type='text/javascript'>
function sub(btn)
{
test_div.innerHTML = "<input type='hidden' name='test_btn' value='7'>";
forms[0].submit();
}
</script>
</head>
<body>
<form action='test.php' method='post'>
<div id='test_div'></div>
<button type='button' name='btn1' onClick='sub(1)'>Button 1</button>
<button type='button' name='btn2' onClick='sub(2)'>Button 2</button>
</form>
</body>
I'm getting a Javascript error, but not sure why.
any Client Sider's out there with an idea?
Cheers,
HK