使用dummytxt进行文本框的问题 [英] Problem using dummytxt for textbox
本文介绍了使用dummytxt进行文本框的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我使用dummytxt作为输入框。
显示正常。但是如果我得到那个输入框值,如果它是空的,则返回dummytxt值。
我如何限制它。是否可以这样做?
例如,
如果文本框为空,意味着我从c#代码中获取输入框值,它返回该虚拟文本(选择值 )。
在这种情况下,我只想要空()值
Hi i m using dummytxt for input box.
It displays fine. But if I get that input box value , if it is empty it return dummytxt value.
How can i restrict it. Is it possible to do it?
For example,
If the textbox is empty, means I get that Input box value from c# code it return that dummytxt("Select Value").
In that case I want get empty("") value only
推荐答案
你可以使用HTML5占位符属性。看看这个例子:
http://davidwalsh.name/html5-placeholder [ ^ ]
或者使用jquery和一些插件:
http://digitalbush.com/projects / watermark-input-plugin / [ ^ ]
或者只是检查自己是否为空或伪文本,如果是,则拒绝它。
祝你好运!
You could use the HTML5 placeholder attribute. Have a look here for an example:
http://davidwalsh.name/html5-placeholder[^]
Or use jquery with some plugin for this:
http://digitalbush.com/projects/watermark-input-plugin/[^]
Or simply check yourself if the value is empty or dummytxt and reject it if so.
Good luck!
这篇关于使用dummytxt进行文本框的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文