placeholder

updating “placeholder” attribute using knockout

空扰寡人 提交于 2019-11-30 04:40:27
I have a form with some fields getting some data using knockout.js (ver. 2.1.0). For example, to update the "value" field of an input I put: <input type="text" name="contrasena" id="login-user" value="" placeholder="" data-bind="value: user"> I have a JSON to store the value a I want to use for "pass" keyword, and it works correctly. I tried to set "placeholder" attribute using the same method, but it doesn't works: <input type="text" name="contrasena" id="login-user" placeholder="" data-bind="placeholder: user"> I tried to modify knockout.js file adding "ko.bindingHandlers['placeholder']"

Simple way to check if placeholder is supported?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 04:37:36
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 appreciated! Trott function placeholderIsSupported() { var test = document.createElement('input'); return (

python django+bootstrap4+mysql智慧交通系统构建

纵然是瞬间 提交于 2019-11-30 04:32:34
之前,我做了一个实训的项目,但是一直没有展示如何做的,现在就让我讲解一下如何用django+bootstrap4+mysql实现这个智慧交通系统。这里用到的是网页的bootstrap4框架和mysql数据库。 一:软件项目内容 1.实训项目简介   智慧交通系统是旨在提高员工的日常工作便捷性、工作效率,降低管理及运营成本的实用项目。本软件系统将为该公司提供车辆信息管理、员工信息管理、线路信息管理、站点信息管理、排班方案管理等功能,同时提供了近场通讯功能(NFC)。利用这些功能充分满足该公交公司日常工作中的管理及信息同步需求。 2.用到的uml图 (1)用例图 首先是需求分析环节,先判断需要的用例,各个外部人员的角色:   管理员用例,可以管理所有信息:   调度员用例,只能操作排班,其他只能查看:      调度员,只能查看排班信息:   (2)数据流图 数据流图是描绘数据在软件中流动和被处理的逻辑过程的模型。它与数据字典一起用来构成系统的逻辑模型。 总的数据流图: 三层数据流图:   0 层图: 顶层图把数据的流动进行了抽象,泛化。只对管理员和调度人员直接进行了数据流动分析,分为处理事务 , 排班信息 和查询排班信息 。   1层图:      1层图对顶层图进行了细分,分为人员信息,车辆信息,线路信息和站点信息管理。 (3)系统功能图 3.数据库设计 (1)ER图: (2

How can I implement Stack Overflow-like watermarks in forms?

喜夏-厌秋 提交于 2019-11-30 02:10:43
I remember seeing a tutorial somewhere that talks of how to style your input forms in a more “usable” way. Essentially, you have a placeholder value and when you enter the input, it hides the hint so to speak. Now, just to be clear: I don't want the hint (placeholder value text) to disappear on focus, but rather to go lighter when I first start typing something. Good examples: Check out the forms on Aardvark . This is exactly how I wish to have my input forms. Our very own Stack Overflow — when you try to ask a question, on clicking inside any input form, it doesn't hide the text right away.

ZKPlaceholderTextView

痞子三分冷 提交于 2019-11-30 01:38:23
// // ZKPlaceholderTextView.h // WaterProofer // // Created by HELLO WORLD on 2019/9/18. // Copyright © 2019年 WaterProofer. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface ZKPlaceholderTextView : UITextView @property(copy,nonatomic) NSString *placeholder; @property(strong,nonatomic) NSIndexPath * indexPath; //最大长度设置 @property(assign,nonatomic) NSInteger maxTextLength; //更新高度的时候 @property(assign,nonatomic) float updateHeight; /* 增加text 长度限制 @param maxLength @param limit */ -(void)addMaxTextLengthWithMaxLength:(NSInteger)maxLength andEvent:(void(^)

移动端日期选择插件

纵然是瞬间 提交于 2019-11-30 01:17:00
index.html <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>rolldate demo</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <style type="text/css"> h1{font-size:30px;} .form-control[readonly]{background:none;} @media(max-width:414px){.form-control{font-size:12px;}} @media(max-width:360px){.form-control{font-size:10px;padding:0 5px;}} @media(max-width:320px){.col-xs-6 {padding:0 5px;}} <

How do you make Placeholder and Label Transitions?

喜欢而已 提交于 2019-11-29 23:59:19
问题 I am looking to find an example of how to make a label / placeholder transition move up and out of placeholder position into a label position and vice versa.. Example: https://www.xero.com/us/signup/ 回答1: General sibling selectors & :focus does the trick in a very simple way ;) input{ position:absolute; top:20px; } input ~ span{ transition:top .7s ease; position:absolute; top:20px; } input:focus ~ span{ top:0px; } <label> <input> <span>Text</span> </label> here is an example with multiple

UISearchBar change placeholder color

巧了我就是萌 提交于 2019-11-29 20:46:21
Has anyone any idea or code sample on how can I change the text color of the placeholder text of a UISearchBar? for iOS5+ use the appearance proxy [[UILabel appearanceWhenContainedIn:[UISearchBar class], nil] setTextColor:[UIColor redColor]]; Wayne Liu Found the answer from Change UITextField's placeholder text color programmatically // Get the instance of the UITextField of the search bar UITextField *searchField = [searchBar valueForKey:@"_searchField"]; // Change search bar text color searchField.textColor = [UIColor redColor]; // Change the search bar placeholder text color [searchField

CSS :after input placeholder not working in mozilla

匆匆过客 提交于 2019-11-29 17:36:33
I want to put a small icon in my text input placeholder right where my placeholder text ends <input type="text" placeholder="Search "> With CSS I want to add a magnifier icon. This works perfectly in Chrome, but I want to make it work for Firefox as well. For Chrome I used ::-webkit-input-placeholder:after{content:url('magnifier.jpg');} And with Firefox I've tried input:-moz-placeholder:after{content:url('magnifier.jpg');} and input:-moz-placeholder::after{content:url('magnifier.jpg');} but for some reason it's not working. ....................... Input elements are replaced elements. Pseudo

placeholder for input type date html5

旧城冷巷雨未停 提交于 2019-11-29 16:09:23
placeholder does not work for input type date directly. <input required="" type="text" class="form-control" placeholder="Date"/> instead, it shows mm/dd/yyy how to show Date ? use onfocus="(this.type='date')" , example: <input required="" type="text" class="form-control" placeholder="Date" onfocus="(this.type='date')"/> use onfocus and onblur... Here it's an example: <input type="text" placeholder="Birth Date" onfocus="(this.type='date')" onblur="if(this.value==''){this.type='text'}"> Here, I have tried data attribute in input element. and applied required placeholder using CSS <input type=