我有一个带有表格的表格,该表格的每一行都是不同的报价。因此,我每行中也有一些按钮,用于下载报价文档或删除报价。该按钮提交表单,然后转到执行所需操作的另一个php文件。
我的问题是,在我提交表单之前,必须检查所需行的单选按钮。对于javascript,有没有办法当您单击这两个按钮之一时,首先它会自动选择该行的单选按钮,然后提交表单?
<form class="filterSelection" action="../php/editOffer/getInfo.php" method="POST">
<table class="accountsTable">
<thead>
<tr>
<th>Selected</th>
<th>Project ID</th>
<th>Revision</th>
<th>Project Description</th>
<th>Customer</th>
<th>Date</th>
<th>Creator</th>
<th>Documentation</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="radio" name="selectedOffer" id="selectedOffer" required="" value="1-1"></td>
<td>1</td>
<td>1</td>
<td>Test</td>
<td>Info</td>
<td>2020-02-10</td>
<td>Name</td>
<td>
<button type="submit" class="download" name="action" value="Download"><i class="fa fa-download" aria-hidden="true"></i></button>
</td>
<td>
<button type="submit" class="delete" name="action" value="Delete" onclick="return confirm('Do you want to delete the selected offer? This action can´t be undone')">
<i class="far fa-trash-alt"></i>
</button>
</td>
</tr>
</tbody>
</table>
<br>
<button name="action" class="nextButton" type="submit" value="Next"><i class="fas fa-arrow-alt-circle-right fa-2x"></i></button>
</form>
拉风的咖菲猫
慕侠2389804
心有法竹
有只小跳蛙