How to avoid automatic focus on first input field when popping a HTML form as a JQuery dialog?

What I did was I created an extra input and made it invisible (style=”display:none”) then gave it the property autofocus=”true” put this at the end of your dialog content so it wont mess with anything. it should look like this: <div><!–dialog div–> <button></button> <button></button> <input type=”hidden” autofocus=”true” /> </div>

How to add placeholder attribute to JSF input component?

I thought everything that was not JSF was passed to the browswer for rendering? This assumption is thus wrong. Unspecified component attributes are ignored by the JSF renderers. You have basically the following options to get it to work: If you’re already on JSF 2.2 or newer, set it as a passthrough attribute. <… xmlns:a=”http://xmlns.jcp.org/jsf/passthrough”> … Read more

Placeholder CSS not being applied in IE 11

In general, when styling placeholders When encountering an unsupported vendor prefix, CSS parsing engines will consider the entire rule invalid, which is why a separate ruleset for each vendor prefix is required. Additionally, I found that IE11 requires the !important flag to override the default user agent styles: /* – Chrome ≤56, – Safari 5-10.0 … Read more

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

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 $.support.placeholder or jQuery.support.placeholder anywhere in your code. NB This code adapted from diveintohtml5, the link provided by hellvinz above.