Questions tagged [html-input]

The input element represents a typed data field, usually with a form control to allow the user to edit the data.

The input tag in HTML specifies an input field where the user can enter data.

<input> elements are used within a <form> element to declare input controls that allow users to input data.

An input field can vary in many ways, depending on the type attribute.

Tips and Notes

Note: The <input> element is empty, it contains attributes only and no closing </input> tag.

Tip: Use the <label> element to define labels for <input> elements.

757 questions
189
votes
7 answers

Using Pipes within ngModel on INPUT Elements in Angular

I've an HTML INPUT field. and I want to format its value and use an existing pipe: .... [(ngModel)]="item.value | useMyPipeToFormatThatValue" .... and get the error…
user3025289
186
votes
10 answers

Get data from file input in JQuery

I actually have a file input and I would like to retrieve the Base64 data of the file. I tried: $('input#myInput')[0].files[0] to retrieve the data. But it only provides the name, the length, the content type but not the data itself. I actually…
kschaeffler
  • 4,083
  • 7
  • 33
  • 41
152
votes
10 answers

How to handle floats and decimal separators with html5 input type number

Im building web app which is mainly for mobile browsers. Im using input fields with number type, so (most) mobile browsers invokes only number keyboard for better user experience. This web app is mainly used in regions where decimal separator is…
devha
  • 3,307
  • 4
  • 28
  • 52
151
votes
13 answers

How do I stop Chrome from yellowing my site's input boxes?

Among other text and visual aids on a form submission, post-validation, I'm coloring my input boxes red to signify the interactive area needing attention. On Chrome (and for Google Toolbar users) the auto-fill feature re-colors my input forms…
Dave Rutledge
  • 5,525
  • 7
  • 27
  • 24
145
votes
18 answers

how to POST/Submit an Input Checkbox that is disabled?

I have a checkbox that, given certain conditions, needs to be disabled. Turns out HTTP doesn't post disabled inputs. How can I get around that? submitting the input even if it's disabled and keeping the input disabled?
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
117
votes
2 answers

Why is HTML5 input type datetime removed from browsers already supporting it?

I was wondering why all browsers, like Chrome versions higher than 26, which had support in the past for the input datetime removed it? This sounds like a duplicate of this article, but that one is quite aged. It looks like the HTML WG prefers…
Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
115
votes
3 answers

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

I have the following HTML structure and I am trying to use Selenium to enter a value of NUM:
My title
cppb
  • 2,319
  • 8
  • 32
  • 37
111
votes
14 answers

How do I cancel form submission in submit button onclick event?

I'm working on an ASP.net web application. I have a form with a submit button. The code for the submit button looks like . I want to write something like the following: function…
Vivian River
  • 31,198
  • 62
  • 198
  • 313
110
votes
8 answers

How to force keyboard with numbers in mobile website in Android

I have a mobile website and it has some HTML input elements in it, like this: I have embedded the site into a WebView for possible Android 2.1 consumption, so that it will also be an Android…
ncakmak
  • 4,014
  • 5
  • 20
  • 17
106
votes
9 answers

Drop Down Menu/Text Field in one

I'm working on building new site, and I need a drop down menu to select the amount of something in my site. But at the same time I need this drop down list to accept text. So if the client wants to choose from the drop down list then he can, also if…
khalid jarrah
  • 1,561
  • 5
  • 14
  • 18
103
votes
6 answers

How to add button inside an input

Using HTML and CSS, how do I visually place a button inside an input element as shown below? The user should be able to interact with the input as normal. The text shouldn't go behind the button, even when it's long. Focus should work correctly.…
Vlad Otrocol
  • 2,952
  • 7
  • 33
  • 55
102
votes
4 answers

Background color in input and text fields

I would like to change the color background in the text and input fields of a form, but when I do this it also affects the submit button! Could it be done in some other way that does not affect the button? I have used this code: input, textarea { …
3D-kreativ
  • 9,053
  • 37
  • 102
  • 159
95
votes
5 answers

HTML: Characters allowed for name attribute of input element?

I have a PHP script that will generate s dynamically, so I was wondering if I needed to filter any characters in the name attribute. I know that the name has to start with a letter, but I don't know any other rules. I figure square brackets…
DLH
  • 2,771
  • 3
  • 23
  • 30
91
votes
20 answers

HTML5 Email input pattern attribute

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…
Colton
  • 995
  • 1
  • 7
  • 10
84
votes
9 answers

Event fired when clearing text input on IE10 with clear icon

On chrome, the "search" event is fired on search inputs when user clicks the clear button. Is there a way to capture the same event in javascript on Internet Explorer 10?
ghusse
  • 3,200
  • 2
  • 22
  • 30
1
2
3
50 51