Multi-Language Field Error Mesage - Client Side Validation

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mehmetbkm
User
Posts: 8

Multi-Language Field Error Mesage - Client Side Validation

Post by mehmetbkm »

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.


arbei
User
Posts: 9384

Post by arbei »

After changing field phrases, make sure you have re-generated all the language files (under the "lang" folder) and re-uploaded them to your development/production server.


mehmetbkm
User
Posts: 8

Post by mehmetbkm »

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?


mehmetbkm
User
Posts: 8

Post by mehmetbkm »

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>


arbei
User
Posts: 9384

Post by arbei »

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.


Webmaster
User
Posts: 9427

Post by Webmaster »

arbei wrote:

I think it should use the phrase "IncorrectRegExp" (i.e. "Regular expression not matched") which exists in the language file.

Try v2024.9.


Post Reply