我已經檢查在SOF這個問題, How to prevent form element from sending some fields we don't want?空變量ONLY
這裏是我的代碼
的index.php
<script type="text/javascript">
$(formElement).submit(function() {
... how to do the jquery stuff..
return true;
});
<?php
$my_variable_with_value1 = 'abc';
$my_variable_with_value2 = 'def';
$another_one_variable = 'mango';
?>
<form method="post" action="process.php">
<input type="text" id="id1" name="name1" value="<?php echo $my_variable_with_value1 ?>" />
<input type="text" id="id2" name="name2" value="<?php echo $my_variable_with_value2 ?>" />
<input type="submit" value="Submit" />
</form>
我需要做以下 1 。在頁面提交之前,我需要使用JQUERY ONLY 取消設置/清空變量值2.我必須在index.php中顯示變量,而不是在下一頁process.php
換句話說,我哪有空變量$ my_variable_with_value1和$ another_one_variable前網頁遞交使用jQuery
感謝, Kimz
您沒有在窗體中使用$ another_one_variable。那你爲什麼要解除它? – Jenz
所以你不想傳遞ID爲'id1'&'id2'的文本字段? – dreamweiver