Copy link to clipboard
Copied
I'm creating a fillable form in Adobe and I want to put some sort of verification on the following two fields
- Mobile Phone Number - for Australia - needs to be 10 digits long (and if possible I would like to format it, e.g. XXXX XXX XXX)
- Email Address - just to ensure they have put in a valid email address
I have next to none experience in Java script (apart from cutting and pasting provided scripts).
Thank you.
For the former all you need is the Format setting, it will act as a validation as well (by not allowing the user to enter an invalid value). Go to Properties - Format - Special - Arbitrary mask and enter "9999 999 999" as the mask.
Validating an email address, on the other hand, is extremely complicated. You can search online for some Regular Expressions that do it, or you can use a built-in (undocumented) function that does it, like this:
if (event.value) {
event.rc = CBIsValidEmail(event.value);
if (!event.rc) app.alert("Invalid email address.");
}
Copy link to clipboard
Copied
I'm creating a fillable form in Adobe and I want to put some sort of verification on the following two fields
- Mobile Phone Number - for Australia - needs to be 10 digits long (and if possible I would like to format it, e.g. XXXX XXX XXX)
- Email Address - just to ensure they have put in a valid email address
I have next to none experience in Java script (apart from cutting and pasting provided scripts).
Thank you.
For the former all you need is the Format setting, it will act as a validation as well (by not allowing the user to enter an invalid value). Go to Properties - Format - Special - Arbitrary mask and enter "9999 999 999" as the mask.
Validating an email address, on the other hand, is extremely complicated. You can search online for some Regular Expressions that do it, or you can use a built-in (undocumented) function that does it, like this:
if (event.value) {
event.rc = CBIsValidEmail(event.value);
if (!event.rc) app.alert("Invalid email address.");
}
Copy link to clipboard
Copied
For the former all you need is the Format setting, it will act as a validation as well (by not allowing the user to enter an invalid value). Go to Properties - Format - Special - Arbitrary mask and enter "9999 999 999" as the mask.
Validating an email address, on the other hand, is extremely complicated. You can search online for some Regular Expressions that do it, or you can use a built-in (undocumented) function that does it, like this:
if (event.value) {
event.rc = CBIsValidEmail(event.value);
if (!event.rc) app.alert("Invalid email address.");
}
Copy link to clipboard
Copied
Thank you so much. Perfect.