javascript - How to add regular expression in textarea tag -


this question has answer here:

recently started working html5 tags , i'm new this. working textarea tag. want use regular expression don't see property (like pattern). not available in textarea tag? if so, .js option?

code:

var regex = "^[a-za-z0-9 ]+$";  <textarea placeholder="add name or special instructions" title="add name or special instructions"           id="whofor" maxlength=@specialinstructionsmaxcharlimit name="whofor" rows="2" cols="20">@model.menuitemmodel.whofor</textarea> 

html5 textarea element not support pattern attribute.

even if add pattern attribute, won't work browser ignore it.

you right, need js.


Comments

Popular posts from this blog

multithreading - Exception in Application constructor -

React Native allow user to reorder elements in a scrollview list -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -