我在一個頁面上有兩個表單,每個表單都有一個提交按鈕。多個表單和提交按鈕,但只有一個被提交?
我需要每個按鈕只提交其分配給的表單。
有誰知道我該怎麼做?
下面的代碼:
<body>
<?php
include ("test.txt")
?>
<br> <br>
<form name = "contactForm" action = "php/text_write.php" method = "post">
<textarea rows = "10" cols = "50" name = "text_input">Replace this text with what you want to print on screen</textarea> <br> <br>
<input type= "submit" name = "write_text" value = "Edit Text!">
</form>
</body>
<body>
<form action="php/upload/upload_file.php" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br><br>
<input type="submit" name="upload" value="Submit">
</body>
我很確定這種形式默認情況下。或許第二種形式的名字缺乏對你的欺騙?在Jitendra的評論之後,爲什麼你的HTML中有兩個body標籤? – Fluffeh
您的第二個表單不是很接近''標籤。 :) –
缺少關閉窗體標籤''爲第二個窗體 –