gilbertsavier Posted August 7, 2009 Share Posted August 7, 2009 Hi Everyone,I got a problem with the Regular Expression Validation of custom fields. I have set the following regular expression in a custom text input field:^[A-Za-z0-9._\-]+@{1,1}[A-Za-z0-9._\-]+\.[A-Za-z]{2,3}$When I submit a ticket and fill in 'test@test.com' in this custom field I get the following error for the field:'One of the required field(s) is empty'I tested the same expression in a simple php script with the ereg function and it works without a problem. Anyone knows what the problem is? Link to comment Share on other sites More sharing options...
Ingolme Posted August 7, 2009 Share Posted August 7, 2009 If you can show the exact code you're using we might be able to see what the problem is. Link to comment Share on other sites More sharing options...
boen_robot Posted August 7, 2009 Share Posted August 7, 2009 preg expressions need to be encompassed in delimiters, most typically a "/" (but it can be any character). ereg expressions don't have this requirement. Try it like: /^[A-Za-z0-9._\-]+@{1,1}[A-Za-z0-9._\-]+\.[A-Za-z]{2,3}$/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.