html-input

Html regex pattern: [\d\s-]{3} works but [\d-\s]{3} doesn't. Why?

拟墨画扇 提交于 2019-12-20 05:25:27
问题 Codepen example: https://codepen.io/Trost/pen/KXBRbY Try putting 1 symbol in both fields. I can't get what's wrong. If I test these regex in https://regex101.com, they appear to be identical. <form> Works: <input type="text" name="country_code" pattern="[\d\s-]{3}" title="-23" required> <input type="submit"> </form> <form> Bug: <input type="text" name="country_code" pattern="[\d-\s]{3}" title="- 3" required> <input type="submit"> </form> 回答1: The real root cause here is that the regex [\d-\s]

In MS Edge, placeholder text doesn't disappear after entering text in input type=“number”

﹥>﹥吖頭↗ 提交于 2019-12-20 01:18:06
问题 To see the issue try this Snippet: <div> <span>A number input:</span> <input type="number" placeholder="Enter some TEXT"> </div> <div> <span>A text input:</span> <input type="text" placeholder="Enter some text"> </div> The behavior of input type="number" in: Chrome : Unable to input text. When numbers are input, placeholder text disappears as expected. Internet Explorer : Able to input text, but when text or numbers are input, placeholder text disappears as expected. Edge : Able to input text

Making up down arrow of HTML's input number much bigger and cleaner

白昼怎懂夜的黑 提交于 2019-12-18 20:01:09
问题 Rather than Is it possible to always show up/down arrows for input "number"?, I want to be able to make up/down arrow much bigger and cleaner. What I have right now: I need to make them bigger like this: 回答1: you can wrap a input in and element and style it div { display: inline-block; position: Relative; border: 2px solid grey; border-radius: 10px; overflow: hidden; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none

Display flaw with HTML input type number on iPhone iOS/Safari

妖精的绣舞 提交于 2019-12-18 17:26:07
问题 I want to use HTML input type="number" on a mobile application, in order to indicate to the smarter mobile phones (Android, iPhone and some others), that the numeric keyboard is more interesting for the user than the normal one. This works nicely. So, I have this piece of HTML here: <h3>type="number"</h3> <input type="number" class="input-number"/> <h3>type="text"</h3> <input type="text" class="input-text"/> The important CSS elements applied here are: input { height: 2em; padding: 0.2em 0

Javascript login form doesn't submit when user hits Enter

白昼怎懂夜的黑 提交于 2019-12-18 13:08:25
问题 I'm working on a simple javascript login for a site, and have come up with this: <form id="loginwindow"> <strong>Login to view!</strong> <p><strong>User ID:</strong> <input type="text" name="text2"> </p> <p><strong>Password:</strong> <input type="password" name="text1"><br> <input type="button" value="Check In" name="Submit" onclick=javascript:validate(text2.value,"username",text1.value,"password") /> </p> </form> <script language = "javascript"> function validate(text1,text2,text3,text4) {

What models of Samsung smartphones have missing period for html5 input type=“number”?

此生再无相见时 提交于 2019-12-18 06:18:21
问题 HTML5 has a new input type named "number". On most mobile smartphones this brings up a numeric keypad. On pre-html5 phones the type falls back to "text" and we are OK. Yet, on some models the numeric keypad does not have a period and one cannot click the "symbols" button to add one. Known models with this flaw are: Samsung Galaxy S4, see: Missing period for Samsung Galaxy S4 numeric keypad Samsung Galaxy Note II Samsung Galaxy Tab 2 10". see: Samsung Galaxy Tablet does not allow entering

Removing input placeholder on a printable version of an html page

冷暖自知 提交于 2019-12-18 04:34:25
问题 I have a form with input fields. Each input field has a placeholder attribute. There is also a link displaying the printable version of the same form. My problem is that if I leave the placeholder attribute unchanged and the input field is empty, then the placeholder is actually printed, which is not very good. I am looking for a way to resolve this unfortunate behavior. Right now, the only thing I can think of is traverse the DOM in javascript and remove all the placeholder attributes when

jquery setting hidden input value not working as expected in IE7 and IE8

孤街醉人 提交于 2019-12-18 03:40:12
问题 Continuing adopting my code to work with IE... I have a hidden div containing a form to edit some information. When the user selects the item to edit, this div is shown and the fields are populated with the information for the item. That divs (in simplified terms) looks like this: <div id="editform"> <form action="" method="post" id="qform" name="qform"> First param: <input name="field1" id="field1"/> <br/> Second param: <input name="field2" id="field2"/> <br/> ... <input type="hidden" name=

How to force Razor to make Editorfor to input number type for float variable?

心已入冬 提交于 2019-12-18 01:31:12
问题 Here is my code in MVC 5: @Html.EditorFor(model => model.myfloatvalue, new { @type = "number", @min = "0", @step = "0.01", @value = "0" }) And here is the html code: <input class="text-box single-line" data-val="true" data-val-number="The field Fix Amount must be a number." data-val-required="The Fix Amount field is required." id="myfloatvalue" name="myfloatvalue" type="text" value=""> Not to <input class="text-box single-line" data-val="true" data-val-number="The field Fix Amount must be a

HTML5 input type number vs tel

江枫思渺然 提交于 2019-12-17 20:03:21
问题 I'm working on updating some form inputs to HTML5. I'm not interested in validating the data so much as having the numeric key pad on mobile devices. Input type 'tel' seems to do what I want, I get the numeric keypad on iPad/mobile. Input type 'number' will also give me the numeric keypad, but it also includes the spinner box which I don't want. What I want to know is if it's safe to use type="tel" on a credit card input? Or should I use type="number" and try to disable the spinner somehow. I