Placeholder is a property of html5
Programme I:
Discard the original attribute placeholder, add a sibling span for input, and set absolute positioning for span (the parent node is position:relative;) so that it is above input. The HTML code fragment is as follows:
JS code is as follows (simple write a function, did not write plug-in form, hehe):
function _placeholdertext (phinput, Ph
Summary of solutions for implementing the placeholder Effect
Solution 1:
Discard the original property placeholder, add a sibling node span for the input, and set absolute positioning for the span (the parent node is position: relative;) so that it is located above the input. The html code snippet is as follows:
1 2 3 4 5 6 7 8 9 10 11 12
The js Code is as foll
It is compatible with the text display of placeholder in IE8 input,
if( !('placeholder' in document.createElement('input')) ){ $('input[placeholder],textarea[placeholder]').each(function(){ var that = $(this), text= that.attr('
Placeholder is a placeholder. It is an HTML5 attribute and serves as a prompt for the input field to describe the expected value. Of course, you cannot expect IE to support it, IE6 ~ IE9 does not support HTML5placeholder (
Placeholder is a placeholder. It is an HTML5 attribute and serves as a prompt for the input field
I think you have some knowledge about the automatic focus and placeholder text of HTML5. To use the automatic focus function of HTML5, you only need to add the autofocus attribute in the form field, first, let's take a look at the sample code that uses HTML auto-focus and placeholder text. If you are interested, let's take a look at the sample code that uses HTML auto-focus and
# #placeholder是H5的一个新属性, but below IE9 is not supported, so we encapsulate a function for capability detection.Reference Address: http://www.studyofnet.com/news/1022.html# # #以下是代码部分:1$(function() {2 //If placeholder is not supported, use jquery to complete3 if(!Issupportplaceholder ()) {4 //traverse all input objects except the Password box5$ (' input '). Not ("input[type= ' password ')").
Remember the super stupid super-torture my bug.Error content:Tensorflow.python.framework.errors_impl. Invalidargumenterror:you must feed a value for placeholder tensor ' x_1 ' with dtype float and shape [?, 227,227,3][[node:x_1 = Placeholder[dtype=dt_float, shape=[?,227,227,3], _device= "/job:localhost/replica:0/task:0/device:gpu : 0 "] ()][[node:fc3/_33 = _recv[client_terminated=false, recv_device= "/job:l
HTML5 has done a lot of enhancements to the Web Form, such as input type, Form validation, and so on.
Placeholder is another new property HTML5, when the input or textarea set the property, the content of the value will appear as a gray prompt in the text box, when the text box gets the focus, the prompt text disappears. In the past to achieve this effect is to use JavaScript to control to achieve, Firefox, Google Chrome, etc. to its support, only IE
Input type date solves the problem of mobile terminal display placeholder, inputplaceholder
In a recent project, a new tag attribute of html5 is used. When type = "date" is used, it is found that the placeholder attribute is invalid and cannot be used.
If this is the case, the customer experience is unimaginable.
Finally, I thought about how to fix it with css + js double insurance.Method 1:
Css:
Input [ty
1. Error description2015-09-20 22:30:25 [main] WARN Org.springframework.context.support.genericapplicationcontext-exception encountered During context initialization-cancelling Refresh Attemptorg.springframework.beans.factory.BeanDefinitionStoreException:Invalid Bean definition with name ' Sessionfactory ' defined in class path resource [Applicationcontext.xml]: Could not resolve placeholder ' SPRING.SECURITY.M Apping.directory ' in string value ' ${s
Html5 supports placeholder native. For unsupported browsers (ie), it can be simulated using js.
Js Code
Copy codeThe Code is as follows: (function (){
// Determine whether placeholder is supported
Function isPlaceholer (){
Var input = document. createElement ('input ');
Return "placeholder" in input;
}
// Unsupported code
If (! IsPlaceholer ()){
// Create a cla
In iOS we Uitextfield have placeholder function, but Uitextview does not have this method, sometimes we also need to implement such placeholder function, StackOverflow gives us a way to rewrite the Uitextview, a small amount of code to achieve this function, it is worth learning.#import #import "UIPlaceHolderTextView.h" @interface Uiplaceholdertextview () @property (nonatomic, retain) UILabel * Placeholderl
Many of the current forms prompt using the Form property placeholder, this property is incompatible with IE8 the following browser, I wrote a compatible processing JS//compatible with IE8 the following browser input does not function intelligently if(Navigator.appname = = "Microsoft Internet Explorer" (Navigator.appVersion.match (/7./i) = = "7." | | Navigator.appVersion.match (/8./i) = = "8." | | Navigator.appVersion.match (/6./i) = = "6." | | Nav
Html5 supports placeholder native. For unsupported browsers (ie), it can be simulated using js.Js Code Copy codeThe Code is as follows:(Function (){// Determine whether placeholder is supportedFunction isPlaceholer (){Var input = document. createElement ('input ');Return "placeholder" in input;}// Unsupported codeIf (! IsPlaceholer ()){// Create a classFunction
To improve security and prevent SQL injection when operating databases in QT, you can use named placeholders and location placeholders.
This document uses the name placeholder as an example to demonstrate how to bind a value to a placeholder in the like clause. The Code is as follows:
/* Query the maximum number of limitcnt persons in the person table by employee ID. You can use the ***** No: employee ID t
Scene:Two configuration files: db.properties,application.propertiesReferencing db.properties in the database configurationclass= "..." > At this time, application.properties inside the property will not be loaded into the, if you use @value, will be reported could not resolve placeholder@Controller Public class Firstcontroller { @Value ("${welcome.message}") private String test; @RequestMapping ("/GETW") public String Welcome
You must know HTML5 's new placeholder attribute, right? It doesn't matter if you don't know. The input box has the default text is, often need such an effect, click let the default text disappear, lose focus and let the default text display.
Share a piece of jquery code today, simulating placeholder effects.
JavaScript code:
Copy Code code as follows:
Function
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.