2
我有一個按鈕創建鏈接使用CSS,因此我希望該按鈕提交表單上的鏈接,我試過但沒有任何反應,請幫助我, 謝謝。提交表單上的鏈接使用PHP/JavaScript
<?php
$errors = array();
if(isset($_POST['submit'])=="Find Moving Service") {
echo 'Form Submitted!';
}
?>
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post" name="myForm" id="myForm" >
<input type="hidden" name="submit" value="Find Moving Service" />
<select name="category">
<option value="" >Select a category</option>
<option value="Local Movers" >Local Movers</option>
<option value="Long Distance Movers" >Long Distance Movers</option>
<option value="Office Movers" >Office Movers</option>
<option value="International Movers" >International Movers</option>
</select>
<a href="javascript: submitform()" title="Find Moving Service" class="button_big big_green float-right">Find Moving Service<i></i></a>
</form>
<script type="text/javascript">
function submitform()
{
if(document.myForm.onsubmit())
{
document.myForm.submit();
}
}
</script>
試過它,但鏈接出現在#,沒有..其他..否則thanx答覆。 – Bheem 2012-03-26 12:21:31
@Bheem忘記'返回false;'更新了答案。再試一次。 – 2012-03-26 12:22:14
好的,這個工程在刪除if(isset($ _ POST ['submit'])==「查找移動服務」){.....現在爲什麼PHP ???? :D – Bheem 2012-03-26 12:25:03