首页 > 其他分享 >input设置不可写,只读 disabled 和 readonly

input设置不可写,只读 disabled 和 readonly

时间:2023-04-20 18:10:47浏览次数:28  
标签:Disabled 只读 Readonly disabled readonly input


评:



实现input的只读效果的两种方法:disabled 和 readonly。

Disabled说明该input无效,及其value不会传递给任何程序,比如asp、php等。
Readonly仅仅是无法编辑,不影响其值的传递。

Disabled使用:<INPUT type=”text” name=”username” value=”james” disabled>
Readonly使用:<INPUT type=”text” name=”partNumber” value=”1500″ readonly>

标签:Disabled,只读,Readonly,disabled,readonly,input
From: https://blog.51cto.com/u_16080829/6210078

相关文章

  • convert InputStream to String
      publicStringgetContent(finalURLurl){try{InputStreaminputStream=url.openStream();returnnewScanner(inputStream).useDelimiter("\\A").next();}catch(finalExceptione){......
  • 直播平台源代码,input密码框显示与隐藏
    直播平台源代码,input密码框显示与隐藏一、html部分   <divstyle="margin-top:200px;background:#42b983;width:200px;height:100px">   <input:type="passwordType"v-model="password"placeholder="请输入账号"/>   <img......
  • vue+ant中input输入框校验,不符合条件的输入无效
    1.只能输入数字/小数点/负号2.只能有一个负号,只能有一个小数点3.第一位不能直接输入小数点,输入负号后不能直接跟随小数点4.第一位输入为0时或-0时,只能跟随小数点,不能跟随数字例如01095.小数点后只能输入两位数字,不可输入其他,并且最后一位不能为0 6.因为是实时校验......
  • [nacos]JAR启动并加载/解析Nacos yml格式的配置文件时,报“java.nio.charset.Malformed
    1问题描述原因1:字符集不匹配nacos中配置文件的字符集为A,应用程序的读取配置文件时使用了字符集B,导致使用字符集B解码文件二进制流时字符解码失败。一般问题出在中文注释上原因2:(yml文件)配置格式有误2解决思路2.1原因1:字符集不匹配时方法[1]删除nacos配置文件中......
  • pyqt5-QInputDialog
    1、介绍这是pyqt的对话框输入组件。2、使用getText弹出对话框,让用户输入单行文本getMultiLineText弹出对话框,让用户输入多行文本getInt弹出对话框,让用户输入整数getItem弹出对话框,让用户选择选项fromPySide2.QtWidgetsimportQInputDialog,QLineEdit​#返回值分......
  • vue input每次输入一个字符后自动失去焦点 问题
    我在输入框输入的时候,每输入一次,输入框就自动失去焦点了。ps:实现的功能是,一个列表组件,每个对象中都有一个input输入框。<divclass="addTags"v-for="(item,index)inlist":key="item.title"><inputtype="text"v-model="item.title"></div>原因问......
  • uni-app:input的样式调整(hbuilderx 3.7.3)
    一,js代码:<template><view><inputclass="inputText"style="width:700rpx;height:76rpx;"v-model="mobile"placeholder="请输入手机号"></input>&l......
  • Linux input and ouput command < symbol & > symbol All In One
    Linuxinputandouputcommand<symbol&>symbolAllInOneleftinput/rightoutput<向左侧输入#把文件内容复制到剪贴板中✅$pbcopy<filename.txt>向右侧输出#把剪贴板内容粘贴到文件中✅$pbpaste>filename.txtdemos$echo"helloworld">......
  • input number 数字输入限制
    转自:https://blog.csdn.net/qq_43535970/article/details/127516919inputnumber数字输入限制,最大值最小值输入范围限制前言有时候我们会有一些需求限制输入数字的大小,比如一个24小时数字输入框,7天数字输入框等等,这个时候我们就需要单独进行处理了。解决方案我看了看网上,解决方......
  • input输入框只能输入数字,只能输入字母数字组合
    转自:https://www.jianshu.com/p/fc5d02cdf3d7输入大小写字母、数字、下划线:<inputtype="text"onkeyup="this.value=this.value.replace(/[^\w_]/g,'');">输入小写字母、数字、下划线:<inputtype="text"onkeyup="this.value=this.value.......