submision of disabled element in form
how can I submit disabled i开发者_C百科nputs in a form?
You can't (at least no in anything approaching a sensible way). "disabled" means "do not submit this control"
Perhaps you mean "readonly" instead?
http://www.w3.org/TR/html4/interact/forms.html#h-17.12
By default you can't do this. You could store the value in a hidden input or something if you want to pass it with your form submission.
The only way you could submit a disabled input is use javascript to create a hidden input when something is switched to disabled and remove it when enabled.
If you feel like doing some JavaScript, you could have it enable your form elements when the user clicks submit.
document.getElementById("my-form-element").disabled=false
精彩评论