html-input

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

烈酒焚心 提交于 2019-11-30 15:33:49
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.5em; width: 100%; /* avoid iPhone rounded corners */ border: 1px solid #afb7c1; border-collapse: collapse

Inline Disabling of Firefox Spellcheck?

跟風遠走 提交于 2019-11-30 10:49:34
I researched this a while ago and can't remember how to do it. I want to be able to prevent Firefox from running it's spell-checking functionality on certain input fields from within the page. I know it's possible but can't remember how to set it up. Talk about having a big "duh" moment! I found the answer after some trial & error: <textarea spellcheck="false"></textarea> The "spellcheck" attribute is currently an extra feature available only in Firefox, but it is being considered for inclusion in HTML5 . add the attribute using JQuery $('.textarea_className').attr('spellcheck',false); This

html input range step as an array of values

亡梦爱人 提交于 2019-11-30 09:09:42
问题 I've been playing around with the input type=range for the first time, and ideally I'd like to set the step value to an array of values. I looked over the spec and I see the possibility for a datalist but it seams the data list is only used for highlight values in a range, so to speak, but not setting the values in the range. So, something like this (ideally without a jQuery plugin, etc.): <input type="range" min="1" max="100" value="0" step="1,3,5,10,20"> 回答1: According to the W3C spec, the

Javascript login form doesn't submit when user hits Enter

和自甴很熟 提交于 2019-11-30 08:55:21
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) { if (text1==text2 && text3==text4) load('album.html'); else { load('failure.html'); } } function load(url

HTML5 pattern for formatting input box to take date mm/dd/yyyy?

旧时模样 提交于 2019-11-30 08:22:43
I used jQuery datepicker and I want to restrict my input field with a HTML5 pattern if a user, instead of getting the date from jQuery datepicker, types the date. How can I restrict my users with a HTML5 pattern so that they can just type the date in the form mm/dd/yyyy ? Easiest way is use read only attribute to prevent direct user input: <input class="datepicker" type="text" name="date" value="" readonly /> Or you could use HTML5 validation based on pattern attribute. Date input pattern (dd/mm/yyyy or mm/dd/yyyy): <input type="text" pattern="\d{1,2}/\d{1,2}/\d{4}" class="datepicker" name=

HTML Input cursor position issue in Chrome when value is empty

点点圈 提交于 2019-11-30 06:24:41
问题 Just recently I have noticed out text inputs having a display issue in Google Chrome but only when the text is empty. Notice how in the top image, when the input is empty, the cursor is too high within the text input. But once we type some text it corrects itself: JSFiddle to illustrate. May require Google Chrome version: 38.0.2125.101 m HTML: <input name="tb_password" type="password" id="tb_password" class=" validate[required,custom[password]]" placeholder="Type your password here"

'Accept' attribute of input element is not working

浪尽此生 提交于 2019-11-30 05:22:59
问题 I came across a browse file dialog-control tag in html and the tag was <input id="myfile" name="myfile" type="file" accept="application/pdf"/> but the 'accept' attribute doesn't seems to have any effect. I am using Internet Explorer 8. 回答1: according to the w3schools (http://www.w3schools.com/TAGS/att_input_accept.asp), the 'accept' attribute is not properly supported by any of the major browsers. The filter inside the file browser dialog will not work. You could use a javascript validation

Is it possible to run some HTML5 input types in IE8?

别来无恙 提交于 2019-11-30 04:17:55
问题 Is it possible to run some HTML5 input types in IE8 with any library?? for example with range. Points: <input type="range" name="points" min="1" max="10"> <input type="submit" value="send"> 回答1: You can use modernizr To check if your browser supports HTML5. And you could use Jquery UI Slider it work in IE8 Check this page : http://jqueryui.com/slider/ demo: http://jsbin.com/eduren/1/edit To read slider value/percentage value: var val = $('#slider').slider("option", "value"); 回答2: IE8 doesn't

How to fill up form using CasperJS without form tag

▼魔方 西西 提交于 2019-11-30 03:50:16
问题 I'm new to CasperJS and I'm having problems in logging in into this site http://weibo.com/login.php here's what I've tried this.fill('form#contact-form', { 'username': 'test@test.com', 'password': 'anypassword', }, true); I can't used that since it has no form. so I tried a different method using sendKeys. this.sendKeys('.W_input ', 'tinkerbell@gmail.com'); Now my problem in here is that the input text has no ID in it, only a CLASS and both username and password have the same CLASS in it. how

How to locate and insert a value in a text box (input) using Python Selenium?

拜拜、爱过 提交于 2019-11-29 19:49:12
I have the following HTML structure and I am trying to use Selenium to enter a value of NUM : <div class="MY_HEADING_A"> <div class="TitleA">My title</div> <div class="Foobar"></div> <div class="PageFrame" area="W"> <span class="PageText">PAGE <input id="a1" type="txt" NUM="" /> of <span id="MAX"></span> </span> </div> Here is the code I have written: head = driver.find_element_by_class_name("MY_HEADING_A") frame_elem = head.find_element_by_class_name("PageText") # Following is a pseudo code. # Basically I need to enter a value of 1, 2, 3 etc in the textbox field (NUM) # and then hit RETURN