Search code examples
htmlpostdisabled-input

How can I get disabled inputs in Post


I am using the Google Address Autofill to populate some disabled inputs on the form. The idea is that

  • The user can see the data I am going to save (because not every field returned by Google is saved).
  • And they can not interfere with it and give an invalid mismatched set of fields.

Because the inputs are disabled, I cant see them in $POST when the form is submitted. I could mirror each field onto a hidden but enabled input. Is there a cleaner way to do this ?


Solution

  • You could collect them using javascript and add them to the url of the next form and attach it to the button.