HTML forms are used to pass data to a server. A form is essentially a container that can be used to hold any amount of any subset of several types of data.

learn more… | top users | synonyms (1)

505
votes
25answers
247k views

How to align checkboxes and their labels consistently cross-browsers

This is one of the minor CSS problems that plagues me constantly. How do folks around StackOverflow vertically align checkboxes and their labels consistently cross-browser? Whenever I align them ...
349
votes
19answers
380k views

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 ...
235
votes
23answers
184k views

Resetting a multi-stage form with jQuery

I have a form with a standard reset button coded thusly: <input type="reset" class="button standard" value="Clear" /> Trouble is, said form is of the multi-stage sort, so if a user fills out ...
215
votes
13answers
13k views

When setting a form's opacity should I use a decimal or double?

I'm new to C# and I want to use a track-bar to change a form's opacity. This is my code: decimal trans = trackBar1.Value / 5000; this.Opacity = trans; When I try to build it, I get this error: ...
196
votes
20answers
131k views

How to handle checkboxes in ASP.NET MVC forms?

This seems a bit bizarre to me, but as far as I can tell, this is how you do it. I have a collection of objects, and I want users to select one or more of them. This says to me "form with ...
164
votes
15answers
86k views

Is there a W3C valid way to disable autocomplete in a HTML form?

When using the xhtml1-transitional.dtd doctype, collecting a credit card number with the following HTML <input type="text" id="cardNumber" name="cardNumber" autocomplete='off'/> will flag a ...
155
votes
10answers
151k views

Submitting a form on 'Enter' with jQuery?

I have a bog-standard login form - an email text field, a password field and a submit button on an AIR project that's using HTML/jQuery. When I hit Enter on the form, the entire form's contents ...
146
votes
12answers
326k views

Check if option is selected with jQuery, if not select a default

Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected. (The select is generated with a maze of PHP functions in an app I ...
109
votes
14answers
49k views

In a django form, How to make a field readonly (or disabled) so that it cannot be edited?

In a django form, how do I make a field read-only (or disabled)? When the form is being used to create a new entry, all fields should be enabled - but when the record is in update mode some fields ...
109
votes
14answers
43k views

How do you overcome the html form nesting limitation

I know that xhtml doesn't support nested form tags and I have already read other answers here in stackoverflow regarding this subject, but I still haven't figured out an elegant solution to the ...
98
votes
14answers
63k views

Clearing <input type='file' /> using jQuery

Is it possible to clear an <input type='file' /> control value with jQuery? I've tried the following: $('#control').attr({ value: '' }); But it's not working.
97
votes
30answers
44k views

Is there a Javascript MVC (micro-)framework? [closed]

Are there any client-side Javascript MVC (micro-)frameworks? I have a rather complicated HTML form and it would benefit from the MVC pattern. EDIT: I imagine a good solution would provide the ...
96
votes
6answers
162k views

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 ...
95
votes
2answers
16k views

What is the _snowman param in Ruby on Rails 3 forms for?

In Ruby on Rails 3 (currently using Beta 4), I see that when using the form_tag or form_for helpers there is a hidden field named _snowman with the value of ☃ (Unicode \x9731) showing up. So, what is ...
85
votes
8answers
72k views

How to prevent buttons from submitting forms

In the following page, with Firefox the remove button submits the form, but the add button doesn't. How do I prevent the remove button from submitting the form? <html> <head> <script ...

1 2 3 4 5 2079
15 30 50 per page