Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4513 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I would like a script to control that the user entered the correct value in a field. And If the value is incorrect a pop-up should alert them.

The field in question is the social security number (swedish). A correct value could be: 570322-1453 (YYMMDD-XXXX).

Only numbers and a "-" as the 7th symbol is correct. Everything else is incorrect and should trigger the script onObjectExit.

Thanks in advance!

Posted

You can use this in a second field and just enter your numbers with out the "-" ie you enter 5478546541 and you get 547854-6541

if you have Advanced you can make this a custom function and not need a second field, this would be prefered...

hope it helps


Let(

[$ssn = Filter(social; "0123456789");

$socialsecuritynumber = Left($ssn;6) &"-"   & Right($ssn;4)];

$socialsecuritynumber

)

Posted

why not take control of the field by converting the date and number by using separate parts.

Date Field

Number field

Calculation

Right (Year ( Date ) ; 2) & Left ( 0 & Month ( Date ) ; 2) & Left ( 0 & Day ( Date ); 2) & "-" & Number

120716-1453

120701-1453

amended for single digit days

This topic is 4513 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.