1

Lets get to the problem as I allow open registration on my website(any one can open registration page) but I want only those people able to proceed who have a specific code (like "CDCode"). This is in a form and I want to check it on form Submit.

I know it is possible with onfocusout but javascript can be disabled so not a perfect solution.

I want some solution with pure HTML like with pattern attribute. So anyhow we can make pattern attribute match an exact string?

1
  • 3
    pattern="CDCode" Commented Jul 5, 2017 at 17:14

1 Answer 1

3
<input type="text" name="test" pattern="CDCode" >
Sign up to request clarification or add additional context in comments.

3 Comments

An empty input seems to pass this validation. How do you make it required?
You can add required attribute
Not working for <select> in chrome currently it seems

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.