0

I create a new form in wp header using function wp_login_form(), but form fields are not set required attribute. How to add required to field?

2
  • You can use javascript for enforcing required validation.
    – BlueSuiter
    Mar 3 '18 at 7:59
  • yes its done! using $("#user_login").attr({"placeholder" : "User Name", "required": "required"}); similarly for password field. Mar 3 '18 at 8:53
1
$("#user_login").attr({"placeholder" : "User Name", "required": "required"});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.