Can you have multiline HTML5 placeholder text in a ?

For <textarea>s the spec specifically outlines that carriage returns + line breaks in the placeholder attribute MUST be rendered as linebreaks by the browser. User agents should present this hint to the user when the element’s value is the empty string and the control is not focused (e.g. by displaying it inside a blank unfocused … Read more

Adding placeholder text to textbox

Wouldn’t that just be something like this: Textbox myTxtbx = new Textbox(); myTxtbx.Text = “Enter text here…”; myTxtbx.GotFocus += GotFocus.EventHandle(RemoveText); myTxtbx.LostFocus += LostFocus.EventHandle(AddText); public void RemoveText(object sender, EventArgs e) { if (myTxtbx.Text == “Enter text here…”) { myTxtbx.Text = “”; } } public void AddText(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(myTxtbx.Text)) myTxtbx.Text = “Enter text … Read more

Input placeholders for Internet Explorer

In looking at the “Web Forms : input placeholder” section of HTML5 Cross Browser Polyfills, one I saw was jQuery-html5-placeholder. I tried the demo out with IE9, and it looks like it wraps your <input> with a span and overlays a label with the placeholder text. <label>Text: <span style=”position: relative;”> <input id=”placeholder1314588474481″ name=”text” maxLength=”6″ type=”text” … Read more

How do I auto-hide placeholder text upon focus using css or jquery?

Edit: All browsers support now input:focus::placeholder { color: transparent; } <input type=”text” placeholder=”Type something here!”> Firefox 15 and IE 10+ also supports this now. To expand on Casey Chu’s CSS solution: input:focus::-webkit-input-placeholder { color:transparent; } input:focus:-moz-placeholder { color:transparent; } /* FF 4-18 */ input:focus::-moz-placeholder { color:transparent; } /* FF 19+ */ input:focus:-ms-input-placeholder { color:transparent; } … Read more

Add placeholder text inside UITextView in Swift?

Updated for Swift 4 UITextView doesn’t inherently have a placeholder property so you’d have to create and manipulate one programmatically using UITextViewDelegate methods. I recommend using either solution #1 or #2 below depending on the desired behavior. Note: For either solution, add UITextViewDelegate to the class and set textView.delegate = self to use the text … Read more

Placeholder in UITextView

I made a few minor modifications to bcd’s solution to allow for initialization from a Xib file, text wrapping, and to maintain background color. Hopefully it will save others the trouble. UIPlaceHolderTextView.h: #import <Foundation/Foundation.h> IB_DESIGNABLE @interface UIPlaceHolderTextView : UITextView @property (nonatomic, retain) IBInspectable NSString *placeholder; @property (nonatomic, retain) IBInspectable UIColor *placeholderColor; -(void)textChanged:(NSNotification*)notification; @end UIPlaceHolderTextView.m: #import … Read more

How do I make a placeholder for a ‘select’ box?

A non-CSS – no JavaScript/jQuery answer: <label>Option name <select> <option value=”” disabled selected>Select your option</option> <option value=”hurr”>Durr</option> </select> </label> Update (December 2021): This works for latest Firefox, Chrome, and Safari. It used to not work for many browsers in the past, as pointed out in the comments.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)