Today I Learned - Rocky Kev

Tagged “forms”

  1. TIL CSRF Attacks

    Cross-site Request Forgery (CSRF) is submitting post data from a fake site. To prevent CSRF attacks, web applications should implement measures such as requiring a valid CSRF token to be included with each request, checking the referer header, and using secure cookies.

  2. TIL How to auto-grow textarea with pure css

    To do this, you replicate the content of the '<textarea>' in an element that can auto expand height, and match its sizing.Same font, same padding, same margin, same border… everything.

  3. TIL of the selectopt group

    You can create some cool dividers for your field options using the 'optgroup' element.

  4. TIL Vue3 has modifiers built in for input forms

    v-model.number="num2" type="text"

  5. TIL Value as Number

    Returns the value of the element, interpreted as one of the following, in order: A time value, A number, NaN if conversion is impossible.

  6. TIL about Constraint Validation API (forms)

    Inputs are pretty powerful. Right out of the box, they can autocomplete, validate data, create minimum/maximum lengths, allow for patterns, and even provide state!

  7. TIL prohibit inserting text

    You may want to prevent the user from pasting text copied from somewhere in the input fields by calling its method preventDefault().

  8. TIL Disabling the submit buttons is bad

    Disabling the submit buttons is bad

  9. TIL Putting error messages above the field

    Putting error messages above the field

See all tags.