2013-02-26 24 views
0

一個按鈕,我有一個表格有一個按鈕提交值輸入的文本框:如何使復位

<form id="form1" name="form1" method="post" action="gallery.php"> 
............ 

..... 

... 

<input type="submit" name="button" id="button" value="Filter" /> 
<a href="gallery.php">Reset</a> 

我的問題是與復位。我怎樣才能讓它成爲一個按鈕呢?

約瑟夫

回答

0

你的意思是:

<input type="button" name="Reset" id="Reset" value="Reset" onclick="window.location.href='gallery.php'"/> 
+0

我感謝名單將嘗試兩個。 – user1868306 2013-02-26 07:32:47

0

您可以使用:

<input type="button" name="button" id="button" value="Reset" /> 

$('#button').click(function(){ 
window.location.href = "gallery.php"; 
}); 

如果你不想使用jquery則:

<input type="button" name="button" id="button" onclick="window.location.href = 'gallery.php';" value="Reset" />