How to send data from a form using the POST method if some fields are input disabled = "disabled"? It does not allow to send data from the form. Is there a way or need to make out abled and only after that send?
4 answers
<input name="input_name" type="text" value="input_value" readonly="" /> readonly="" instead of disabled="disabled"
- This option is not provided for some reasons - lifesmilecompany
- may not be specified specifically in your case, but not - not provided?) - Palmervan
- It just became even interesting, what could be the reasons for this? After all, there’s only a difference between disabled and readonly, and the difference is that readonly is sent, but disabled is not. - DemoS
|
Field type is hidden - religion does not allow to use?
- No, it does not. A specific question is possible or not. - lifesmilecompany
- It happens that when you click on such input, the list is already made by handles, clicking on the list item, the value entry goes to this input! A user who fills in a certain form is fun when he sees that the value he has selected is displayed! - Palmervan
|
Perhaps in your case you will have to do exactly as you said: hang up on onsubmit a function that unlocks all input fields (or sculpts input: hidden from them).
|
Personally, I don’t use a submission at all and I avoid the appropriate form tag, instead I assign a common class to the input and send it using jquery.ajax (). IMHO it is much more convenient. Jquery will perfectly select all even the "disabled" fields and send them where you specify. Example
UPD I apologize, made a mistake - now everything works in an example.
$.ajax({ type: "POST", url: "file.php", data: "?data="+$("input.submit").val() }); |