I have a field named "phone". I validate this field with "regural expression". I use two languages and write an error message in both languages in the "error message" property of this field. When verifying, I always get the "Incorrect field value" warning instead of the error message I created.
Multi-Language Field Error Mesage - Client Side Validation
-
- User
- Posts: 8
I activated client-side (JavaScript) from the PHP settings in the general options. I used the following regular expression for the phone field: /\+90\d{10}$/ sample phone: +905051112233
then, I went to the "error message" field and set my own error message for two languages using the Multi-Language Property Editor. Do you need any other settings?
-
- User
- Posts: 8
i can see my own error messages in the lang folder in the project.en-US.xml file and project.tr-TR.xml . but it doesn't work
<field id="phone">
<phrase id="fldcaption" value="phone" />
<phrase id="flderrmsg" value="Sample Format: +905051112233" />
<phrase id="custommsg" value="Sample Format: +905051112233" />
</field>
<field id="phone">
<phrase id="fldcaption" value="Telefon" />
<phrase id="flderrmsg" value="Örnek Format: +905051112233" />
<phrase id="custommsg" value="Örnek Format: +905051112233" />
</field>
-
- User
- Posts: 9419
The client side validators does not use field error message, it uses the global "IncorrectXXX" phrases such as "IncorrectField" for regular expression. I think it should use the phrase "IncorrectRegExp" (i.e. "Regular expression not matched") which exists in the language file.