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
0
votes
1 answer

boolean input_filed calls immediately the method on Rails

The project which I am working in, is developed on Rails using haml markup to views. There is a view with a simple form like this: = simple_form_for @message, url: [:admin, @request, @message], html: { class: 'form vertical-form} do |f| = f.input…
Iván Cortés
  • 581
  • 1
  • 9
  • 22
0
votes
0 answers

Load Data from table into several input fields

I got a Question: How can I load data from my table into input fields? The data in the table comes from these input fields saved in cookie. In the table I have an image with a function, but I don't know what I should write in the function to get…
0
votes
1 answer

What change should I make to this particular css for errors while using jquery validate?

I have a basic registration form. For styling the input fields, my css code is below, but I'm using code from this demo from codrops: http://tympanus.net/codrops/2015/01/08/inspiration-text-input-effects/ I'm using the second example in particular…
fancy_avocado
  • 45
  • 1
  • 6
0
votes
1 answer

Value from two input fields / Alert

i got an aesy formular with a few input fields that i must validate. the Question is: how can i check that if the two input fields are empty? and than give out an alert?
0
votes
0 answers

virtual and physical keyboards ENTER not executing form

having a bizarre issue. I have two forms on a single page. Each form has a single input field. While focus is on the input field in form1, the key within the virtual keyboard and physical keyboard as well as the clickable "SET" button all submit…
0
votes
1 answer

how to show placeholder value after setting the value of input field as empty ""?

I have input field with id = datepicker validationfails = true; if(validationfails) { $('#datepicker').val(''); $('#datepicker').attr('placeholder','mm/dd/yyyy'); } I want to show the placeholder, if validation fails. But the…
Karthik Amar
  • 217
  • 5
  • 17
0
votes
1 answer

Generate specific number of InputFields via code?

I have a GUI with 1 Input Field. When the user types in a number in there, for instance, "3", it has to generate 3 input fields within my canvas, so he can select the name of each player. Any tips on how I could achieve such thing? Thanks!
Diego Fortes
  • 8,830
  • 3
  • 32
  • 42
0
votes
1 answer

Adding place holder by jquery doesn't work fine

I have a input field with id 'datepicker' While validating, if date mentioned is not valid I am empty the field and adding the placeholder if(validationfails) { $("#datepicker").val(''); …
Karthik Amar
  • 217
  • 5
  • 17
0
votes
1 answer

If input reaches max value, the second can have max value -1

I got a form, here's the jQuery code and HTML. As you can see, the form has 8 input fields which are divided into 4 pairs. Every input can have only values from 0 to 4. How can I achieve this behavior: If one of the input fields has the value 4,…
Marcin
  • 220
  • 3
  • 14
0
votes
1 answer

Jquery UI Datepicker does not focus input

I am trying to create a form using the jquery ui datepicker. Everything works perfectly except that since I changed the design of the input fields the placeholder attribute is not removed when a date is picked. Here is the fiddle:…
Schwesi
  • 4,753
  • 8
  • 37
  • 62
0
votes
2 answers

Check a input field if it includes numbers and characters

Heyho guys! I have some street field which should normally includes the house number, so i want check the field if it contains characters and numbers (0-9). If both are right, the input is correct. Btw, i don't want use regex. Would be awesome, when…
CallMeBronxy
  • 75
  • 10
0
votes
1 answer

Showing Android soft keyboard for an HTML field even when an input device is attached

There is an Android tablet with a barcode scanner connected via USB. This tablet shows an intranet web site. Because the Android OS detects an input device, it stops displaying the soft keyboard when focus goes into a field on the screen. Most of…
GSerg
  • 76,472
  • 17
  • 159
  • 346
0
votes
1 answer

CakePHP show and hide form fields dynamically

I have a CakePHP website used by multiple clients. Each client shall be able to see slightly different input fields in forms. This is due to client preferences. A simplified example: Clients should be able to look up books from a big list. While…
kaffeeguru
  • 111
  • 1
  • 6
0
votes
1 answer

iPhone text input field zoom- control zoom area

So I'm working on a mobile form and I know that iPhone zooms in on input fields. The issue is that the iPhone is zooming in and cutting off the labels for each field (image attached). My client would like the form to zoom with the labels still…
noelietrex
  • 321
  • 1
  • 3
  • 8
0
votes
2 answers

Getting value from an input field Javascript

I have a form which fills the input fields on page load off of MySQL server, but when I try to assign it's value to a JavaScript variable, it crashes. Here is JS; function getTotal(e) { total = myform2.1.value; } It just crashes and here…
SoftwareEnthusiast
  • 271
  • 2
  • 9
  • 26