If a select tag has visibility:hidden, is its value submitted on form submit?

html

Solution

Yes.

visibility: hidden; will hide the element, but use the space it would have otherwise taken. It is still enabled and thus its data still sent.

and

display: none; will hide the element, completely (space and all). It is still enabled and thus its data still sent.

You (currently) cannot disable via CSS, but can via Javascript or JQuery. CSS is for styling, not function.

How do I disable form fields using CSS?

You can style disabled fields: http://www.w3schools.com/cssref/sel_disabled.asp

Problem

If you applied `visibility: hidden` to a select tag, are its values submitted when you submit the form it's in? Example CSS: ``` .my-select { visibility: hidden; } ``` Example HTML: ``` <select class="my-select"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> ```

Original source

Related problems