hrueda Posted May 17, 2016 Share Posted May 17, 2016 I need to create a rule that will return value of x in front of a number value. Thanks! Quote Link to comment Share on other sites More sharing options...
step Posted May 17, 2016 Share Posted May 17, 2016 Assuming you're asking because the value of 'x' is also a numeric value and you don't want the two values to be added together, you need to convert the two values to a string: return String(1) + String(23); // returns 123 If you had more than just two numbers you might find it easier to use an array: return [1,2,3].join(''); // returns 123 Quote Link to comment Share on other sites More sharing options...
hrueda Posted May 18, 2016 Author Share Posted May 18, 2016 I will reiterate as I think I was vague before. When a user enters a 3 digit number which will be used for a phone extension I would like a script that will place an x in front of those 3 digits. Thanks Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 18, 2016 Share Posted May 18, 2016 When a user enters a 3 digit number which will be used for a phone extension I would like a script that will place an x in front of those 3 digits. And if the user enters something else then...what? var s = Field("YourFieldName"); if (s.match(/\d{3}/)) return "x" + s; //else return s; // OR ??? return ""; 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.