Questions tagged [forms]

A form is essentially a container that can be used to hold any amount of any subset of several types of data. HTML forms are used to pass data to a server. VB and C# forms are the windows used to interact with the user.

A contains elements which are inputs and outputs.

These inputs may include text fields, checkboxes, radio-buttons, submit buttons, hidden inputs (hidden from the agent filling the form) and more.

A web form element also is characterized by the action that will be undertaken on submit and the method used to make the request (HTTP GET or POST).

VB and C# forms are the windows used to interact with the user.

Standard form declaration is,

<form action="form_action" method="submit_method">
{input elements, here you can declare any html 
 tag and all you input fields that can be text fields, 
 checkboxes, radio-buttons, submit buttons and more }


What is an HTML Form

HTML Forms are required to collect different kinds of user inputs, such as contact details like name, email address, phone numbers, or details like credit card information, etc. Forms contain special elements called controls like inputbox, checkboxes, radio-buttons, submit buttons, etc. Users generally complete a form by modifying its controls e.g. entering text, selecting items, etc. and submitting this form to a web server for processing. The <form> tag is used to create an HTML form. Here's a simple example of a login form:

<form method="POST" action="some_action>
        <legend>Log In</legend>
        <label>Username: <input type="text"></label>
        <label>Password: <input type="password"></label>
        <input type="submit" value="Submit">
113270 questions
11 answers

The definitive guide to form-based website authentication

Moderator note: This question is not a good fit for our question and answer format with the topicality rules which currently apply for Stack Overflow. We normally use a "historical lock" for such questions where the content still has value.…
Michiel de Mare
  • 41,982
  • 29
  • 103
  • 134
102 answers

How do you disable browser autocomplete on web form field / input tags?

How do you disable autocomplete in the major browsers for a specific input (or form field)?
Brett Veenstra
  • 47,674
  • 18
  • 70
  • 86
40 answers

How to align checkboxes and their labels consistently cross-browsers

This is one of the minor CSS problems that plague me constantly. How do folks around Stack Overflow vertically align checkboxes and their labels consistently cross-browser? Whenever I align them correctly in Safari (usually using vertical-align:…
One Crayon
  • 19,119
  • 11
  • 33
  • 40
32 answers

JavaScript post request like a form submit

I'm trying to direct a browser to a different page. If I wanted a GET request, I might say document.location.href = ''; But the resource I'm trying to access won't respond properly unless I use a POST request. If this were not…
Joseph Holsten
  • 20,672
  • 6
  • 25
  • 29
21 answers

jQuery AJAX submit form

I have a form with name orderproductForm and an undefined number of inputs. I want to do some kind of jQuery.get or ajax or anything like that that would call a page through Ajax, and send along all the inputs of the form orderproductForm. I suppose…
Nathan H
  • 48,033
  • 60
  • 165
  • 247
36 answers

Prevent users from submitting a form by hitting Enter

I have a survey on a website, and there seems to be some issues with the users hitting enter (I don't know why) and accidentally submitting the survey (form) without clicking the submit button. Is there a way to prevent this? I'm using HTML, PHP…
  • 19,789
  • 13
  • 59
  • 84
18 answers

What characters are allowed in an email address?

I'm not asking about full email validation. I just want to know what are allowed characters in user-name and server parts of email address. This may be oversimplified, maybe email adresses can take other forms, but I don't care. I'm asking about…
  • 10,281
  • 6
  • 23
  • 28
69 answers

Chrome ignores autocomplete="off"

I've created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89). Despite both the input fields AND the form field having the autocomplete="off" attribute, Chrome insists on…
Mr Fett
  • 7,979
  • 5
  • 20
  • 21
21 answers

Get checkbox value in jQuery

How can I get a checkbox's value in jQuery?
  • 12,278
  • 21
  • 78
  • 153
13 answers

Send POST data using XMLHttpRequest

I'd like to send some data using an XMLHttpRequest in JavaScript. Say I have the following form in HTML:
Jack Greenhill
  • 10,240
  • 12
  • 38
  • 70
23 answers

Two submit buttons in one form

I have two submit buttons in a form. How do I determine which one was hit serverside?
  • 43,191
  • 44
  • 96
  • 127
18 answers

Set the default value of an input field

How would you set the default value of a form text field in JavaScript?
  • 6,988
  • 6
  • 30
  • 36
68 answers

Disabling Chrome Autofill

I have been running into issues with the chrome autofill behavior on several forms. The fields in the form all have very common and accurate names, such as "email", "name", or "password", and they also have autocomplete="off" set. The autocomplete…
  • 6,306
  • 3
  • 14
  • 6
16 answers

Best way to track onchange as-you-type in input type="text"?

In my experience, input type="text" onchange event usually occurs only after you leave (blur) the control. Is there a way to force browser to trigger onchange every time textfield content changes? If not, what is the most elegant way to track this…
Ilya Birman
  • 9,834
  • 4
  • 27
  • 31
26 answers

Twitter Bootstrap Form File Element Upload Button

Why isn't there a fancy file element upload button for twitter bootstrap? It would be sweet if the blue primary button was implemented for the upload button. Is it even possible to finesse the upload button using CSS? (seems like a native browser…
  • 8,856
  • 20
  • 64
  • 130
2 3
99 100