Submitting Form Fields Beyond Visibility
Concealing form elements with display: none CSS poses a challenge when submitting data. Only visible elements are transmitted to the server, leaving completed fields hidden within display: none elements inaccessible.
Solution: Visibility and Positioning
To overcome this limitation, consider using visibility: hidden and position: absolute instead. By setting elements to visibility: hidden, they remain hidden but still participate in form submissions. Complementing this with position: absolute ensures they retain a visual presence off-screen.
Clarification
Although the original answer recommended this workaround, it's worth noting that recent browser updates have resolved the issue. As of November 2015, form fields now submit successfully even when set to display: none. However, disabled fields remain excluded from submissions.
The above is the detailed content of How Can I Submit Hidden Form Fields?. For more information, please follow other related articles on the PHP Chinese website!