如何解决如何使下拉列表和单选按钮为只读?
我希望将下拉列表和单选按钮设置为只读,以便可以接受输入。我不想禁用它。
下拉列表...
<select name="ctitle" readonly>
<option selected value=" "> </option>
<%do until rsPositions.eof
strContent = rsPositions("descrip")
StrValue = rtrim(rsPositions("descrip"))
intThisId = rsPositions("id")
if ucase(rtrim(strCtitle)) = ucase(strValue) then%>
<option selected value="<%=strValue%>"><%=StrContent%></option>
<%else
if not StrReadOnly then%>
<option value="<%=strValue%>"><%=StrContent%></option>
<%end if
end if
rsPositions.movenext
loop%>
</select>
单选按钮...
<%if StrCurtype="H" then%>
<input type="radio" name="curtype" value="H" checked >
<% else%>
<input type="radio" name="curtype" value="H">
<% end if%>Hourly
<% if StrCurtype="S" then%>
<input type="radio" name="curtype" value="S" checked >
<% else%>
<input type="radio" name="curtype" value="S" >
<% end if%>
Salary(<%=StrPayCycleDes%>)
解决方法
我不认为这些元素支持readonly
。您将不得不禁用它们。如果仍然需要收集值,请考虑使用隐藏的输入。
您可以尝试这样做:
<input type="radio" name="name" checked onclick="this.checked = true;" />
或者您的单选按钮代码可能是这样的:
if StrCurtype="H" then%>
<input type="radio" name="curtype" value="H" checked onClick="return false;">
<% else%>
<input type="radio" name="curtype" value="H" onClick="return false;">
<% end if%>Hourly
<% if StrCurtype="S" then%>
<input type="radio" name="curtype" value="S" checked onClick="return false;">
<% else%>
<input type="radio" name="curtype" value="S" onClick="return false;">
<% end if%>Salary(<%=StrPayCycleDes%>)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。