2. 数据收集
在 el-form 上面指定 model,在 el-input 组件加 v-model 进行双向数据绑定
3. 数据校验
在el-form 上面指定 rules 校验规则,在 el-form-item 组件加 prop,指定要校验的字段
3.2 表单预校验,当所有的内容都符合规则了,才去调用对应的接口
————————————————
原文链接:https://blog.csdn.net/weixin_57435656/article/details/120915409
文本框无法使一部分字的样式和其它不一样的.除非你用在线编辑器才可以.
我帮你写了 提问 没帮你写 补充
代码如下(自己测试过):
<script type="text/javascript" language="javascript">
function add(){
window.document.getElementById("content").value=window.document.getElementById("content").value+"1111"
window.document.getElementById("content").focus()
}
</script>
<form id="form1" name="form1" method="post" action="">
<textarea name="content" id="content" cols="45" rows="5"></textarea>
<input type="button" name="button" id="button" value="输入一个你要的字符串" onclick="add()" />
</form>
你的补充问题我可以给你个思路:
你可以用空格代替按钮帮你输入的字符,进行数据库 *** 作时遇到空格就替换成你需要的字符.
加个样式就可以了:<style>
#alert{
width:300pxheight:100pxborder:1px solid blackz-index:999
margin:0 autoposition:relativetop:150px
display:nonebackground:orange
}
#btn-confirm{
position:absoluteleft:100pxtop:80px
}
#btn-cancel{
position: absoluteleft:150pxtop:80px
}
</style>
同时,JS这里加几个字会好看一些:
//将表单的值显示在对话框上
document.getElementById('label-username').innerHTML="你提交的第一个数据是:"+document.getElementById('username').value
document.getElementById('label-password').innerHTML="你提交的第二个数据是:"+document.getElementById('password').value
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)