placeholder

How to use placeholders instead of labels in simple_form?

让人想犯罪 __ 提交于 2019-12-18 14:07:14
问题 I want to use placeholders everywhere in my application instead of labels. I am using simple_form and Rails (3.2.14). How can I specify in simple_form config file to use placeholders instead of labels. In Initializers there is a file simple_form.rb ie # Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| # Wrappers are used by the form builder to generate a # complete input. You can remove any component from the # wrapper, change the order or

How to use placeholders instead of labels in simple_form?

瘦欲@ 提交于 2019-12-18 14:06:10
问题 I want to use placeholders everywhere in my application instead of labels. I am using simple_form and Rails (3.2.14). How can I specify in simple_form config file to use placeholders instead of labels. In Initializers there is a file simple_form.rb ie # Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| # Wrappers are used by the form builder to generate a # complete input. You can remove any component from the # wrapper, change the order or

Adding <sup> asterisk to placeholder, or a nice way to mark required fields via placeholder

[亡魂溺海] 提交于 2019-12-18 13:37:26
问题 I'm looking for a way to style the asterisk in the placeholder. Plain text like this in placeholder does not satisfy me: Your e-mail* Note that the placeholder text is variable, so static background will not play the trick 回答1: :after works but you need to target the placeholder and not the input element...and then you can use position: absolute; and top, left properties to move your * anywhere you want to... Demo (Am not sure about other syntax but I've tested on webkit as am using firefox <

Simple way to check if placeholder is supported?

ぐ巨炮叔叔 提交于 2019-12-18 11:38:23
问题 I want to use the HTML5 "placeholder" attribute in my code if the user's browser supports it otherwise just print the field name on top of the form. But I only want to check whether placeholder is supported and not what version/name of browser the user is using. So Ideally i would want to do something like <body> <script> if (placeholderIsNotSupported) { <b>Username</b>; } </script> <input type = "text" placeholder ="Username"> </body> Except Im not sure of the javascript bit. Help is

Removing input placeholder on a printable version of an html page

冷暖自知 提交于 2019-12-18 04:34:25
问题 I have a form with input fields. Each input field has a placeholder attribute. There is also a link displaying the printable version of the same form. My problem is that if I leave the placeholder attribute unchanged and the input field is empty, then the placeholder is actually printed, which is not very good. I am looking for a way to resolve this unfortunate behavior. Right now, the only thing I can think of is traverse the DOM in javascript and remove all the placeholder attributes when

Python placeholders in strings containing the % symbol

大兔子大兔子 提交于 2019-12-17 23:29:10
问题 I want to be able to use a placeholder in a string that already contains a % symbol. For instance, I would like to be able to iterate to open multiple URLs by my URL already contains a % symbol, example url: http://www.example.com/BLABLA%123BLABLApage=1 To do so, I want to replace the number 1 by a placeholder ( %d ), but the code seems to be confused by the presence of the % that comes before the placeholder. 回答1: You can escape % by doubling it: >>> 'http://www.example.com/BLABLA%

h5新增标签

偶尔善良 提交于 2019-12-17 22:18:22
语义标签: <article>定义文章</article> <aside>定义文章侧边栏</aside> <figure>定义一组媒体对象以及文字内容</figure> <figcaption>定义figure的标题</figcaption> 布局页面时用的语义标签: <nav>定义导航</nav> <header>头部</header> <section>定义文档中的区段 区域</section> <footer>尾部</footer> input其他的类型: 1. text 文本输入框 2. password 密码 3. button 按钮 4. checkbox 复选 5. radio 单选 6. submit 提交 7. reset 重置 8. file 文件 9. email 输入邮箱地址 检测@ 10. url URL地址 11. number 只能输入数字 还有e 12. range 范围 默认0~100 required 必须填写 placeholder 占位符 http://www.cnblogs.com/li-na/p/5524579.html http://www.daqianduan.com/2857.html 一、HTML5新增标签 1. <article> 标签: 定义外部的内容。比如来自一个外部的新闻提供者的一篇新的文章、或者来自 blog 的文本

How to test if the browser supports the native placeholder attribute?

南楼画角 提交于 2019-12-17 21:54:46
问题 I'm trying to write a simple placeholder jQuery plugin for a site of mine but of course I only want to fire the function if the native placeholder attribute isn't supported… How can I use jQuery to test for native support of the placeholder attribute? 回答1: You can add to $.support quite easily by inserting this at the top of the Javascript you've written: jQuery.support.placeholder = (function(){ var i = document.createElement('input'); return 'placeholder' in i; })(); You can then use either

overriding placeholder font css in all browsers

最后都变了- 提交于 2019-12-17 20:38:22
问题 I am trying to override the font of all headers, input, select, text area and input placeholders on my site with the following code: h1, h2, h3, h4, h5, h6, button, input, select, textarea, :-ms-input-placeholder, ::-moz-placeholder, :-moz-placeholder, ::-webkit-input-placeholder { font-family:some font name; } The problem is, for some reason it isn't working on Chrome. If I delete the :-moz and :-ms references, then chrome works fine, which leads me to believe that Chrome doesn't like pseudo

Add span inside form's placeholder

匆匆过客 提交于 2019-12-17 11:54:11
问题 I wanna add a color asterix in my form's placeholder, is it possible? 回答1: Here is pure css solution IE10+ .input-placeholder { position: relative; } .input-placeholder input { padding: 10px; font-size: 25px; } .input-placeholder input:valid + .placeholder { display: none; } .placeholder { position: absolute; pointer-events: none; top: 0; bottom: 0; height: 25px; font-size: 25px; left: 10px; margin: auto; color: #ccc; } .placeholder span { color: red; } <form novalidate> <div class="input