html-input

Android browser refreshes page after selecting file via input element

旧城冷巷雨未停 提交于 2019-11-27 11:59:39
问题 I have a mobile web page which includes an input element of type 'file', to allow users to upload image files to a server. The page works fine on iOS, and on a Nexus 4 (Android 4.2.1) in the Chrome Browser. When I use a Samsung S3 (Android 4.0.4) with the default browser clicking on the 'Choose file' button opens the image selection dialog as expected, however after I choose an image and close the dialog the web page gets refreshed, so I lose the image that was selected. Has anyone else seen

How to overcome WhatWG/W3C/Chrome version 33.0.1750.146 “regression bug” with <input type=“number”/> fields

隐身守侯 提交于 2019-11-27 11:45:34
问题 I put the words "regression bug" in quotes as there is obviously some mixed opinions on this. For full details track Bug 24796 in Bugzilla. In short Google Chrome implemented changes according to the latest version of the WhatWG specs: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary that removed the following properties and methods from <input type="number"/> fields. Properties: selectionStart selectionEnd Methods: select()

How to align texts inside of an input?

早过忘川 提交于 2019-11-27 11:30:46
For all default inputs, the text you fill starts on the left. How do you make it start on the right? Use the text-align property in your CSS: input { text-align: right; } This will take effect in all the inputs of the page. Otherwise, if you want to align the text of just one input, set the style inline: <input type="text" style="text-align:right;"/> Gautam3164 Try this in your CSS: input { text-align: right; } To align the text in the center: input { text-align: center; } But, it should be left-aligned, as that is the default - and appears to be the most user friendly. Cynthia Here you go :

ASP.NET MVC HTML helper methods for new HTML5 input types

一个人想着一个人 提交于 2019-11-27 11:04:39
问题 HTML5 appears to support a new range of input fields for things such as: Numbers Email addresses Colors URLs Numeric range (via a slider) Dates Search boxes Has anyone implemented HtmlHelper extension methods for ASP.NET MVC that generates these yet? It's possible to do this using an overload that accepts htmlAttributes , such as: Html.TextBoxFor(model => model.Foo, new { type="number", min="0", max="100" }) But that's not as nice (or typesafe) as: Html.NumericInputFor(model => model.Foo, min

HTML5 Email Input Pattern Attribute

廉价感情. 提交于 2019-11-27 10:44:38
I’m trying to make a html5 form that contains one email input, one check box input, and one submit input. I'm trying to use the pattern attribute for the email input but I don't know what to place in this attribute. I do know that I'm supposed to use a regular expression that must match the JavaScript Pattern production but I don't know how to do this. What I'm trying to get this attribute to do is to check to make sure that the email contains one @ and at least one or more dot and if possible check to see if the address after the @ is a real address. If I can't do this through this attribute

CSS selector for text input fields?

前提是你 提交于 2019-11-27 08:59:53
问题 How can I target input fields of type 'text' using CSS selectors? 回答1: input[type=text] or, to restrict to text inputs inside forms form input[type=text] or, to restrict further to a certain form, assuming it has id myForm #myForm input[type=text] Notice: This is not supported by IE6, so if you want to develop for IE6 either use IE7.js (as Yi Jiang suggested) or start adding classes to all your text inputs. Reference: http://www.w3.org/TR/CSS2/selector.html#attribute-selectors Because it is

Hot to get incomplete datetime-local input values

青春壹個敷衍的年華 提交于 2019-11-27 06:11:04
问题 I have the following form on my page: <input id='startDate' type='datetime-local' step=1 name='startDate'> I use this code to get the value of the field: var start = $('#startDate').val(); My problem is that the value of the input field remains undefined until every part of it has been filled out, including hours, minutes, seconds, and AM/PM. I would like to be able to get a value from the form with as little as just the year selected. How can I go about doing this? I'm happy to zero out the

Thymeleaf - How to add checked attribute to input conditionally

帅比萌擦擦* 提交于 2019-11-27 05:39:33
问题 As you know, input component has an attribute, checked to whether mark the checkbox as enabled by default or not. <input type="checkbox" name="mycheckbox" checked="checked"/> To disable the checkbox by default, the checked exception should be declared. Is it possible to set checked attribute by a flag in Thymeleaf? 回答1: According to the official thymeleaf documentation http://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#fixed-value-boolean-attributes th:checked is considered as a

How to stop buttons from staying depressed with Bootstrap 3

∥☆過路亽.° 提交于 2019-11-27 05:11:47
问题 How do you make a button in Bootstrap 3 undepress automatically after being clicked? To replicate my problem, make a page with some buttons, give them appropriate bootstrap classes (and include bootstrap): <input id="one" type="button" class="btn btn-default" value="one"> <input id="two" type="button" class="btn btn-primary" value="two"> Load the page and click on one of the buttons. It becomes depressed and highlighted until you click somewhere else on the page (using FF29 and chrome35beta).

Button type “button” vs. “submit”

故事扮演 提交于 2019-11-27 05:08:22
Is there a difference between a button with type="button" vs type="submit" ? Are there functional differences, or is it just a descriptive name for easier code reading? Is this different than input ? From MDN : type The type of the button. Possible values are: submit : The button submits the form data to the server. This is the default if the attribute is not specified , or if the attribute is dynamically changed to an empty or invalid value. reset : The button resets all the controls to their initial values. button : The button has no default behavior. It can have client-side scripts