hi i have a form ...i want to validate the fields in such a way it does not accept if the user is trying to enter numeric instead of characters..........
eg in a name field if the user is trying to enter number....the typed data should not come...it should act like readonly field..........
kings -7 Junior Poster
Recommended Answers
Jump to PostHi.
I use this function to validate name in my forms :
function valName($name) { $name = preg_replace(‘/[\s]+/is’, ‘ ‘, $name); $name = trim($name); return preg_match(‘/^[a-z\s]+$/i’, $name); }
Jump to PostI would validate on both client side and server side(because sometimes, the user might have disabled the javascript!)
All 8 Replies
MitkOK 61 Junior Poster
OmniX 21 Practically a Master Poster
kings -7 Junior Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster
OmniX 21 Practically a Master Poster
OmniX 21 Practically a Master Poster
hooray 1 Junior Poster in Training
OmniX 21 Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.