javascript - How to ensure HTML input remains required? -



javascript - How to ensure HTML input remains required? -

if create form using html inputs , create input required using "required" attribute (<input type="text" required>), stopping user manually deleting attribute using web browser's built in developer tools or loading javascript other means (such bookmarklet)?

in other words, how can ensure required input remains required?

you need consider few things:

everything on client side can modified client: nil stopping me using browser console or modifying source code alter parts of page, , can't stop that. instance, how many upvotes question has:

doesn't anything, that's because of heavy lifting done stack exchange's servers.

even if create field required, people can still fill in field space or asdf , move on. because input required doesn't mean valid.

so, in mind, realize you'll need work on server side validate input. people can't mess servers (easily) , it's safest way validate input. you'll need deal validation when server receives info because client side vulnerable user modification.

javascript html html-input

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -