I have a form in a php page with a lot of text inputs in it, with a presetted value each.
When someone submit the page by POST, I would like to know which of them have been changed, so I thought I could set a property of the text (like background colour) when someone type in the text input.
After the submit, how can I get the properties of inputs to see if they have been changed? $_POST[‘name_of_text_input’] return only the value of the input?
You can’t see if they have been changed as simply as that.
PHP runs on the server, and once the data has been sent to the user, as far as PHP is concerned, that’s the end of it. It doesn’t remember anything else unless you specifically tell it to remember (via a
sessionor some data in the database).You will have to do one of the following: