Ok so here's the deal... I have mostly French-speaking customers and they'll type-in their name with accents (such as é, à, è, etc.) in the following script

$string_exp = "/^[A-Za-z .'-]+$/"; 
if(!preg_match($string_exp,$prenom)) {     
$error_message .= 'Invalid name<br />';

It will say "invalid name". I know that to fix this I need to change something in the A-Za-z part of the script, but I don't know what the proper code is.

Thanks for your help, greatly appreciated!!

EDIT: I am aware that when I will receive the emails the é or à will not appear correctly and I am ok with this, but I don't want it to be a problem for the client when he sends the form.

Edited by riseguim: n/a

7 Years
Discussion Span
Last Post by riseguim

It doesn't work... but I just found another way to do it and it works well

$string_exp = "/^[A-Za-zé.¸UûÙùàÀèÈéÉïÏîÎôÔêÊçÇ .'-]+$/";

Thanks anyway!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.