I'm working on a web app project (in java; not that it matters) and we have a form with drop down lists and input fields.
Obviously drop down lists are provided because we expect a specific value from a set of values.
So my question is this: does it make sense to ensure the submitted value is in the set of expected values? Or is it acceptable to just assume the correct value is coming across?
There aren't any "errors" that would arise from different values being submitted,
but the data store would not be consistent with the business rules/requirements. How would a user submit a value that isn't in the list of choices? Are you trying to catch people copying the code from View Source, altering it, and submitting that? And, doesn't the data store have a foreign key constraint to a table containing the acceptable values?
以上就是HTML select list validation的详细内容，更多请关注web前端其它相关文章！