Buy Now
Sign in

How to use Validation: Contains

omidhz , August 07 2019, 04:23
O
omidhz 295
August 07 2019, 04:23 #388693
I can't figure out how to use the validation "Contains" field. I want users to be able to enter numbers and letters only (No space or special characters), but I'm not sure what language/code should I enter here for that purpose.
Thanks
healyhatman 8
August 07 2019, 10:23 #388705
 Answer
You need regex, not "contains".
/^[A-Za-z0-9]*$/
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
O
omidhz 295
August 07 2019, 10:48 #388709
Thank you. That worked.
However, for my knowledge, what is the use for "contain" and how do you use it?
healyhatman 8
August 07 2019, 10:49 #388710
To make sure the contains a specific string
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
O
omidhz 295
August 07 2019, 10:53 #388711
Thank you.