Can we match an exact string using html pattern at

2019-08-18 03:41发布

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条回答
Lonely孤独者°
2楼-- · 2019-08-18 04:06
<input type="text" name="test" pattern="CDCode" >
查看更多
登录 后发表回答