浅析easyui中的readonly和h5中的readonly

本文探讨了在使用easyui时,如何正确处理input框的readonly属性。当使用h5的readonly属性,通过removeProp()方法后,虽然输入框可编辑,但无法获取编辑后的值。而使用easyui的data-options="readonly:true"则不会有此问题。同时,文章提到了disabled属性在动态提交表单中的应用,建议在使用easyui时避免与h5属性混用。
摘要由CSDN通过智能技术生成

在使用easyui的过程中,有时会将input框的readonly属性和easyui的readonly属性混用,然后动态修改这一状态,但在easyui中如果使用h5的readonly属性,使用removeProp("readonly");方法后,虽然input框可以编辑,但value却获取不到最新编辑后的值。

代码如下:
 

<div>
    <input type="text" class="easyui-textbox" readonly="readonly" name="name" value="JOK" id="name">
</div>
-- 前
<div>
    <input type="text" class="easyui-textbox textbox-f" readonly="readonly" value="JOK" id="name" textboxname="name" style="display: none;">
    <span class="textbox textbox-readonly" style="width: 171px;">
        <input id="_easyui_textbox_input5" type="text" class="textbox-text validatebox-text validatebox-readonly" autocomplete="off" tabindex="" readonly="readonly" placeholder="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 22px; line-height: 22px; width: 163px;">
        <input type="hidden" class="textbox-value" name="name" value="JOK">
    </span>
</div>
$('input[readonly="readonly"]').remo
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

潭影空人心

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值