C.courtens Posted December 2, 2013 Share Posted December 2, 2013 hello, Sorry for my English, I'm french. I'm in trouble with my javascript code for a rule. I try to change the color of my text but fusion pro doesn't interprate the code, it just translate into html. var s = Field("tel"); s = s.replace(/\D/g,""); if (s.length == 10) { return "" + "" +Left(s,1) + "" + s.substring(1,2) +" " + s.substring(2,2)+ "" + s.substring(4,2) +" "+ s.substring(6,4) +" "+ s.substring(8,6) + " " +Right(s,2); } else { string1="!!!! NUMERO DE TELEPHONE NON CONFORME !!!!" ; return '<color name="red">' + string1 + "</color>"; } I just want to write a message if the phone number is not correct (10 numbers in my country), but FB write « <color name="red">!!!! NUMERO DE TELEPHONE NON CONFORME !!!!</color> » Can someone help me ? Quote Link to comment Share on other sites More sharing options...
mclisa81 Posted December 2, 2013 Share Posted December 2, 2013 Hi, I believe if you check the box "Treat returned strings as tagged text" in your rule editor, that should do the trick. Lisa Quote Link to comment Share on other sites More sharing options...
C.courtens Posted December 2, 2013 Author Share Posted December 2, 2013 thank you It works better Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.