Questions tagged [input-field]

The `` tag specifies an input element. `input` elements are used within a `form` element to declare input controls that allow users to input data. An input control can vary depending on its `type` attribute.

The <input> tag 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


Browser Support

CHROME IE FF SAFARI http://www.w3schools.com/images/compatible_safari.gif OPERA


Tips and Notes

Note: The <input> element is empty, it contains attributes only.

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


Type Attribute Values

button

Defines a clickable button (mostly used with a JavaScript to activate a script)


checkbox

Defines a checkbox


color

Defines a color picker

HTML5


date

Defines a date control (year, month and day (no time))

HTML5


datetime-local

Defines a date and time control (year, month, day, hour, minute, second, and fraction of a second (no time zone)

HTML5


email

Defines a field for an e-mail address

HTML5


file

Defines a file-select field and a Browse... button (for file uploads)


hidden

Defines a hidden input field


image

Defines an image as the submit button


month

Defines a month and year control (no time zone)

HTML5


number

Defines a field for entering a number

HTML5


password

Defines a password field (characters are masked)


radio

Defines a radio button


range

Defines a control for entering a number whose exact value is not important (like a slider control)

HTML5


reset

Defines a reset button (resets all form values to default values)


search

Defines a text field for entering a search string

HTML5


submit

Defines a submit button


tel

Defines a field for entering a telephone number

HTML5


text

Default. Defines a single-line text field (default width is 20 characters)


time

Defines a control for entering a time (no time zone)

HTML5


url

Defines a field for entering a URL

HTML5


week

Defines a week and year control (no time zone)

HTML5


Refers From :

  1. http://www.w3schools.com/tags/tag_input.asp
  2. http://www.w3schools.com/tags/att_input_type.asp
465 questions
4
votes
1 answer

HTML Input field within a mathjax tex equation

I've got a question on Mathjax. I'm attempting to include html input fields such as: within a tex equations. For now, I tried a lot like: $$ \frac{}{1} $$ This won't work at all. Is there a…
MPe
  • 430
  • 6
  • 23
4
votes
4 answers

cakephp hidden field issue

I have a problem with an input field in a view called add.ctp. When the input type is set to 'text', the program sequence is normal. But when I change the input type to 'hidden', the following error is displayed: The request has ben black-holed.…
user2610983
  • 43
  • 1
  • 5
4
votes
1 answer

Chrome doesn't remember input field value

I'm using HTML code like this:
The only thing I do is preventDefault on submit…
dinodsaurus
  • 4,937
  • 4
  • 19
  • 24
4
votes
4 answers

getAttribute of elements with some class doesn't work

I have some input fields with a specific class. They all have a data attribute, say data-somedata with an integer value. I have to calculate the sum of these data attributes. I tried to use getAttribute in combination with getElementsByClassName,…
user1544337
4
votes
5 answers

How can I get the value of an input field in javascript without submitting a form?

I'm fairly new to javascript and have a question about how to get a value of an input field without submitting a form. I have the following small piece of code, which I'm using in combination with a realtime-validation script to validate the…
BlueCola
  • 192
  • 1
  • 2
  • 14
4
votes
5 answers

Why do my HTML form elements move around when clicking on them in IE8?

I have an HTML form with a bunch of input fields (of type text and select). I am floating them such that there are two on each row. In all browsers (including IE7), everything works okay, but for some reason in IE8, whenever I click inside any of…
DecafJava
  • 479
  • 2
  • 7
  • 19
3
votes
2 answers

How can I bring input field texts to address bar?

If I type some texts in the input field, how can I bring those texts to address bar ? for eg : I type abcd to input field, I need address bar like www.google.com/abcd
Jith
  • 33
  • 2
3
votes
1 answer

I want a file value or name when I upload a file in html javascript?