我有一个带有一个按钮的表单来提交值输入的文本框:
<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>
我的问题是重置。我怎样才能使它也成为一个按钮?
约瑟夫
我有一个带有一个按钮的表单来提交值输入的文本框:
<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>
我的问题是重置。我怎样才能使它也成为一个按钮?
约瑟夫
您可以使用 :
<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" />
你的意思是:
<input type="button" name="Reset" id="Reset" value="Reset" onclick="window.location.href='gallery.php'"/>