ASP文本框控件占位符属性不会在Internet Explorer中 [英] ASP Textbox control placeholder property doesn't work in Internet Explorer
问题描述
我用兑现
从 materializecss.com
的框架。为文本框的占位符不工作的IE浏览器,我认为框架有一些与此有关,因为从我的其他网页我用引导框架尝试,并在占位符的财产的工作,有什么解决办法对我来说,使占位符的兑现框架的物业工作?
< DIV CLASS =行>
< DIV CLASS =输入场山坳S10>
< ASP:文本框ID =txtCompany=服务器可见=假占位符=公司名称>< / ASP:文本框>
< / DIV>
< DIV CLASS =输入场山坳S2>
< ASP:按钮的ID =btnSave=服务器文本=保存的CssClass =BTN波效应波红的OnClick =btnSave_Click可见=假/>
< / DIV>
< / DIV>
您需要添加的onfocus
和的onblur
在文本框属性在其工作的Internet Explorer
在这里你去
< DIV CLASS =输入场山坳S10>
< ASP:文本框ID =txtCompany=服务器值=公司名称占位符=公司名称的onfocus =如果(THIS.VALUE == this.defaultValue)THIS.VALUE ='';的onblur =如果(THIS.VALUE =='')THIS.VALUE = this.defaultValue;>< / ASP:文本框>
< / DIV>
I'm using the framework of Materialize
from materializecss.com
. The placeholder for the textbox isn't working on IE, I think the framework has something to do with this because from my other page I tried using bootstrap framework, and the placeholder property worked, is there any solution for me to make the placeholder property work on the Materialize framework?
<div class="row">
<div class="input-field col s10">
<asp:TextBox ID="txtCompany" runat="server" Visible="false" placeholder="Company Name" ></asp:TextBox>
</div>
<div class="input-field col s2">
<asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn waves-effect waves-red" OnClick="btnSave_Click" Visible="false" />
</div>
</div>
You need to add onfocus
and onblur
property in your textbox for working it in Internet Explorer
Here you go
<div class="input-field col s10">
<asp:TextBox ID="txtCompany" runat="server" value="Company Name" placeholder="Company Name" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"></asp:TextBox>
</div>
这篇关于ASP文本框控件占位符属性不会在Internet Explorer中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!