gpt4 book ai didi

html - 无法将单选按钮值发送到 SQL

转载 作者:行者123 更新时间:2023-11-28 03:24:04 24 4
gpt4 key购买 nike

我正在制作一个页面,我需要通过单选按钮从我的表中接受/拒绝行,然后将数据行发送到 SQL 中的表。

我已经坚持了几天了,我在网上找不到任何有用的信息,所以非常感谢任何帮助!

这是我的 HTML:

<div>
<form id="canceltable" onsubmit="" method="post" action="admin.asp">
<table id="CancelRequestTable">
<tr>
<td style="width: 200px;" />
<td style="width: 200px;" />
<td style="width: 200px;" />
<td style="width: 200px;" />
</tr>
<tr>
<th colspan="4">Cancel Request Table</th>
</tr>
<tr>
<td>Name</td>
<td>Start Date</td>
<td>End Date</td>
<td>Accept/Decline</td>
</tr>
<% Set objDBConn=S erver.CreateObject( "ADODB.Connection") objDBConn.Open "Provider=sqloledb;Data Source=*****\SQL2012;Initial Catalog=*****;User ID=****;Password=****;" Set objDBCommand=S erver.CreateObject( "ADODB.Command") objDBCommand.ActiveConnection=o bjDBConn objDBCommand.CommandText="spCancelRequestTable" objDBCommand.CommandType=a dCmdStoredProc Set objDBRS=S erver.CreateObject( "ADODB.RecordSet") objDBRS.open objDBCommand,,adOpenForwardOnly Do until objDBRS.eof %>
<tr>
<td class="Column4Table">
<%response.Write(objDBRS(0))%>
</td>
<td class="Column4Table">
<%response.Write(objDBRS(1))%>
</td>
<td class="Column4Table">
<%response.Write(objDBRS(2))%>
</td>
<td>
<input type="radio" name="radio<%=a%>" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="radio<%=a%>" />
</td>
</tr>
<tr>
<%
a=a+1
objDBRS.movenext
Loop
Set objDBCommand=nothing
objDBConn.Close
Set objDBConn=nothing
%>
</tr>
</table>
<div id="ButtonSubmit2"> <strong><i>Submit</i></strong></div>
</form>
</div>

最佳答案

您没有为单选按钮传递值属性。你想要这样的东西:

<form id="form1" name="form1" method="post">
<input type="radio" name="RadioGroup1" value="radio<%=sql1%>" id="RadioGroup1_0">
<input type="radio" name="RadioGroup1" value="radio<%=sql2%>" id="RadioGroup1_1">
</form>

关于html - 无法将单选按钮值发送到 SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22373914/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com