提交表单 之 提示文字在输入框内部,提示文字怎么处理?
来源:互联网 发布:网络存储服务器价格 编辑:程序博客网 时间:2024/05/17 08:53
<form id="whir_16" res="whirform">
<divclass="contactform">
<divclass="name-bg inputBox">
<labelfor="first-name">First name*</label>
<input id="18147" name="18147" type="text"class="text" maxlength="250" value=""/>
<span name="whirValidator" validatorfor="18147" required="True" requiredmsg="First name required" regexp="" errmsg="First name authentication fails"></span>
</div>
<divclass="name-bg inputBox">
<labelfor="last-name">Last name*</label>
<input id="18148" name="18148" type="text"class="text" maxlength="250" value=""/>
<span name="whirValidator" validatorfor="18148" required="True" requiredmsg="Last name required" regexp="" errmsg="Last name authentication fails"></span>
</div>
<divclass="email-bg inputBox">
<labelfor="company-name">Company name</label>
<input type="text" id="18149"class="text" name="18149"/>
<span name="whirValidator" validatorfor="18149" required="False" requiredmsg="Company name required" regexp="" errmsg="Company name authentication fails"></span>
</div>
<divclass="email-bg inputBox">
<labelfor="telephone">Telephone</label>
<input type="text" id="18150"class="text" name="18150"/>
<span name="whirValidator" validatorfor="18150" required="False" requiredmsg="Telephone required" regexp="" errmsg="Telephone authentication fails"></span>
</div>
<divclass="email-bg inputBox">
<labelfor="email">Email*</label>
<input class="isEmail text" type="text" id="18151" name="18151"/>
<span name="whirValidator" validatorfor="18151" required="True" requiredmsg="Email required" regexp="^\w+([-+.]\w+)*@\w+([-.]\\w+)*\.\w+([-.]\w+)*$" errmsg="Email authentication fails"></span>
</div>
<divclass="subject">
<divclass="subject-title"><p>Subject:*</p></div>
<divclass="subject-bg inputBox">
<labelfor="subject">Subject:*</label>
<input id="18152" name="18152" type="text"class="text" maxlength="250" value=""/>
<span name="whirValidator" validatorfor="18152" required="True" requiredmsg="Subject required" regexp="" errmsg="Subject authentication fails"></span>
</div>
</div>
<divclass="textarea-wrapper">
<h3>Comment/ enquiry:*</h3>
<divclass="textarea-bg inputBox">
<labelfor="comments">Enter your comments here</label>
<textareaclass="mandatory text" rows="5" cols="10" id="17849" name="17849" ></textarea>
</div>
</div>
<p><spanclass="color">*</span>In order to reduce spam email, please type the unique security number into the text area before submitting your enquity.</p>
<divclass="plcMan" style="display: none;">This field is mandatory</div>
<ulclass="buttons">
<li><inputclass="submitMe" onclick="whir.form.submit('whir_16','13','0','16')" value="Submit" type="button"/></li>
<li><inputclass="clearMe" onclick="whir.form.reset('whir_16')" value="Clear form" type="button"/></li>
</ul>
</div>
</form>
.contactform.inputBox{ position:relative;}
.contactform.inputBox label{ position:absolute; height:26px; line-height:26px; left:5px; top:5px; padding:015px; z-index:10;}
.contactform.inputBox.text{ background:none;}
//输入表单
$(".contactform .inputBox").each(function(){ //遍历每一个inputBox
var tips= $(this).find("label");
var input= $(this).find(".text");
//清空内容 - 部分浏览器刷新之后内容还在,造成文字重叠
input.val("");
//获得焦点
input.focus(function(){
tips.hide();
});
//失去焦点
input.blur(function(){
var val= $(this).val();
if(val==""){
tips.show();
}
});
//提示文字点击 - 本身隐藏,使得输入框获取焦点
tips.click(function(){
$(this).hide();
$(this).next(".text").focus();
});
});
阅读全文
0 0
- 提交表单 之 提示文字在输入框内部,提示文字怎么处理?
- html5 输入框提示文字
- 输入框显示提示文字
- input表单提示文字
- 输入框里有文字提示
- 表单提交 小tip(textarea提示文字对齐、JS输入为空验证、java断点)
- 增加表单可用性之提示文字
- 输入框 提示剩余可输入文字
- 使用JavaScript 在input 之 value 输入框文字提示代码
- input文本框输入框智能文字提示
- input输入框添加提示文字
- axure_a1_带提示文字的输入框
- 输入框显示输入提示,点击消失。没输入直接提交,提交的输入框内容为空,不提交显示的提示文字
- 模糊显示输入提示文字
- TextField 输入提示文字浮动
- EditText不消失的提示文字,在提示文字后进行输入
- 怎么在textarea中写提示的灰色文字?
- 密码框提示文字
- 机房-结账
- java面试整理
- TCP与UDP的区别总结
- Python网络数据采集
- pytorch中的pre-train函数模型引用及修改(增减网络层,修改某层参数等)
- 提交表单 之 提示文字在输入框内部,提示文字怎么处理?
- 剑指offer — 调整数组顺序使奇数位于偶数前面
- 机器学习笔记-Radial Basis Function Network
- 2182: [Spoj1479]The GbAaY Kingdom最小直径生成树
- MySQL事物和游标示例
- js滑动进度
- 关于Android studio的模拟器无法打开问题
- charles提示“SSL Proxying not enabled for this host: enable in Proxy Settings, SSL locations”
- Emmet在NotePad++中的安装与使用