<td colspan="1" class="title_label" style="width:10%;"> <i th:if="${currentProcess == null || currentProcess.userId == userId}" class="red">*</i>点检责人:</td> <td colspan="1" style="width:23.33%"> <div class="form-control" th:if="${currentProcess == null || currentProcess.userId != userId || currentProcess.currentNode != 106}" th:disabled="${true}" onclick="selectCreateUser();">‘ 为什么这段不可选 不可编辑会无效?
时间: 2024-02-14 22:19:13 浏览: 21
这代码中的 `th:disabled="${true}"` 属性将该表单元素设置为不可编辑状态。这意味着用户不能在页面上编辑或修改该元素的值。如果您希望该表单元素在页面上可编辑,则需要将该属性更改为 `th:disabled="${false}"` 或者将该属性从代码中完全删除。请注意,如果将该属性从代码中删除,则该元素将默认为可编辑状态。
相关问题
<td colspan="1" class="title_label" style="width:10%;"> <i th:if="${currentProcess == null || currentProcess.userId == userId}" class="red">*</i>点检责人:</td> <td colspan="1" style="width:23.33%"> <div class="form-control" th:if="${currentProcess == null || currentProcess.userId != userId || currentProcess.currentNode != 106}" th:disabled="${true}" onclick="selectCreateUser();">‘ 为什么 这段代码中 <td colspan="1" class="title_label" style="width:10%;"> <i th:if="${currentProcess == null || currentProcess.userId == userId}" class="red">*</i>点检责人:</td> <td colspan="1" style="width:23.33%"> <div class="form-control" th:if="${currentProcess == null || currentProcess.userId != userId || currentProcess.currentNode != 106}" th:disabled="${true}" onclick="selectCreateUser();">‘ 会无效?
这段代码中的 `th:disabled="${true}"` 属性将该表单元素设置为不可编辑状态。如果该属性设置为 `true`,则该表单元素的值不能被修改或编辑。所以,如果您想要启用该表单元素,则需要将该属性设置为 `false` 或者将该属性从代码中删除。另外,还要确保该元素不受其他代码的影响,例如 JavaScript 代码或其他框架的代码,这些代码可能会覆盖或修改该元素的属性。
<td colspan="1" class="title_label" style="width:10%;"> <i th:if="${currentProcess == null || currentProcess.userId == userId}" class="red">*</i>点检责人:</td> <td colspan="1" style="width:23.33%"> <div class="form-control" onclick="selectCreateUser();"> <input type="text" style="border:0;width:80%;" readonly="true" name="createUserName" id="createUserName" th:value="${spotCheck.drawDutyName}" th:if="${currentProcess == null || currentProcess.userId != userId || currentProcess.currentNode != 106}" th:disabled="${true}"/> <img src="/img/contentSearch.png" width="20px" style="float: right;"> </div> <input type="hidden" id="createUserId" th:value="${spotCheck.drawDutyId}"> </td> 为什么这段不能完全禁用选择框
这段代码中,`<input>` 标签的 `th:disabled` 属性只是禁用了用户输入,但是用户仍然可以点击 `<div>` 标签,触发 `onclick` 事件,进而选择点检责人。要完全禁用选择框,可以将 `<div>` 标签也加上 `th:disabled="${true}"` 属性,如下所示:
```
<div class="form-control" th:disabled="${true}" onclick="selectCreateUser();">
```
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
给下面代码增加分页功能,要求细致,逻辑清楚,<form action="./../selectNews" method="post"> <input type="text" name="key" id="key" placeholder="请输入标题"/> <input type="submit" value="查询"/> 发布新闻 返回主页 </form> 新闻编号 新闻标题 <%-- 新闻内容 --%> 新闻类别 发布人 发布时间 状态 是否头条 操作 <c:forEach items="${newslist}" var="u"> ${u.nid} ${u.title} <%-- ${u.content} --%> ${u.type} ${u.userName} ${u.pubTime} <c:choose> <c:when test="${u.state==0}">未审核</c:when> <c:when test="${u.state==1}">审核通过</c:when> <c:otherwise>未通过</c:otherwise> </c:choose> <c:choose> <c:when test="${u.top==0}">否</c:when> <c:otherwise>是</c:otherwise> </c:choose> <c:choose> <c:when test="${user.rule==1}"> 查看 修改 删除 审核 </c:when> <c:when test="${user.rule==0 && user.uid==u.uid}"> 查看 修改 删除 </c:when> <c:otherwise> 查看 </c:otherwise> </c:choose> </c:forEach>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
给下面代码增加分页功能,要求细致,逻辑清楚,<form action="./../selectNews" method="post"> <input type="text" name="key" id="key" placeholder="请输入标题"/> <input type="submit" value="查询"/> 发布新闻 返回主页 </form> 新闻编号 新闻标题 <%-- 新闻内容 --%> 新闻类别 发布人 发布时间 状态 是否头条 操作 <c:forEach items="${newslist}" var="u"> ${u.nid} ${u.title} <%-- ${u.content} --%> ${u.type} ${u.userName} ${u.pubTime} <c:choose> <c:when test="${u.state==0}">未审核</c:when> <c:when test="${u.state==1}">审核通过</c:when> <c:otherwise>未通过</c:otherwise> </c:choose> <c:choose> <c:when test="${u.top==0}">否</c:when> <c:otherwise>是</c:otherwise> </c:choose> <c:choose> <c:when test="${user.rule==1}"> 查看 修改 删除 审核 </c:when> <c:when test="${user.rule==0 && user.uid==u.uid}"> 查看 修改 删除 </c:when> <c:otherwise> 查看 </c:otherwise> </c:choose> </c:forEach>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)