我在一个页面上有两个表单,每个表单都有一个提交按钮。多个表单和提交按钮,但只有一个被提交?
我需要每个按钮只提交其分配给的表单。
有谁知道我该怎么做?
下面的代码:
<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
您的第二个表单不是很接近''标签。 :) –
缺少关闭窗体标签''为第二个窗体 –