日期:2014-05-16 浏览次数:20389 次
<script>
function changeSubmit()
{
alert("here!here!");
var draft_mode="draft";
document.getElementById("incident_form").action = "test.php?mode="+draft_mode;
$("#incident_form").submit();
}
</script>
<?php
这里定义$mode为 new或者edit
?>
<td width="40px"><a href="JavaScript:void(0);"><img src="../images/icons/icon_new_tillbud.png" title="save as draft" onclick="changeSubmit();" > </a></td>
<form method="post" action="incident.php?mode=<?php echo $mode?>" id="incident_form">
<td id="input_1" ><p>输入1:</p><input name="shuru_1" type="text" /></td>
<td id="input_2" ><p>输入2:</p><input name="shuru_2" type="text" /></td>
<input type="button" value="submit" >
</form>
<?php
echo " Yes!!!";
$mode = $_POST["mode"];
echo "<br>";
echo $mode;
echo "<br>";
echo "hehe!";
?>