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 }
.
</form> 

Reference

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>
    <fieldset>
        <legend>Log In</legend>
        <label>Username: <input type="text"></label>
        <label>Password: <input type="password"></label>
        <input type="submit" value="Submit">
    </fieldset>
</form>
106674 questions
2973
votes
89 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
  • 44,790
  • 17
  • 65
  • 84
1802
votes
39 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
  • 18,759
  • 9
  • 30
  • 38
1637
votes
31 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 = 'http://example.com/q=a'; But the resource I'm trying to access won't respond properly unless I use a POST request. If this were not…
Joseph Holsten
  • 19,514
  • 6
  • 23
  • 28
1017
votes
20 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
  • 44,105
  • 54
  • 154
  • 235
848
votes
33 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…
DForck42
  • 17,905
  • 12
  • 52
  • 79
692
votes
17 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…
WildWezyr
  • 8,671
  • 5
  • 21
  • 28
619
votes
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…
templaedhel
  • 6,317
  • 3
  • 11
  • 5
607
votes
18 answers

Get checkbox value in jQuery

How can I get a checkbox's value in jQuery?
maztt
  • 11,509
  • 19
  • 73
  • 147
595
votes
20 answers

Two submit buttons in one form

I have two submit buttons in a form. How do I determine which one was hit serverside?
Alex
  • 37,703
  • 43
  • 90
  • 124
595
votes
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…
somejkuser
  • 8,273
  • 18
  • 51
  • 111
582
votes
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
  • 8,952
  • 11
  • 37
  • 67
564
votes
3 answers

How to disable the resize grabber of