Example : In a form, some fields ( input
) are loaded via ajax from a select
. The% selected% will be used in the backend to validate those fields.
However, the user can load a certain option, fill in their fields, and intentionally change the value (in the browser) of the selected option
tag to another valid value, for example, and forward it to the server.
How to ensure consistency of data coming from an HTML form? Which techniques / methods are essential?
I understand that this can be handled with certain conditions in the backend. My search is for which are the best practices. For example, I think that for every
option
, I should store an identifier token in aoption
, so I could easily check if the data is referring to the selected option.