validation not working

Avatar

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 2

12-10-2020

Hello,

I have a form which requires a phone number to be entered.  I created a text field to appear so that you can enter the phone number and I have a validation tied to the field so that it warns you to enter 10 digits which would display (000) 000-0000. The problem is that when I enter less than 10 digits, I get two warnings and whatever is in the block is entered into the form.  I want it to not do anything until 10 digits are entered.  Can anyone help?  FYI- I used "Action Builder" for the button to hide after a number is entered into the block because I could not figure out the script.  So this is how the button and field works.

After I enter the person's name, a text block with a button appears so that I can enter the phone number.  If I enter less than 10 digits, a warning box shows up and tells me to enter the phone number like 1111111111.  I click ok and another warning box shows up with the same information.  I click ok again, then whatever is currently in the block (less than 10 digits or any letter, etc.) is entered into the form and then the block disappears.  It doesn't allow me to fix the error prior to entering the phone number into the form.  

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile
Kosta_Prokopiu1
Employee

13-10-2020

I would approach this as follows: I used the Phone Number - North America from the Custom library and adapted the formatting patterns as follows:

Display: text{'('999')' 999-9999}  Edit: text{9999999999}  Validation: text{9999999999}

In the exit event I add the lines :

if(this.rawValue.length > 0 && this.rawValue.length < 10) {
     xfa.host.setFocus(this.somExpression);
}

Which returns to the field while still wrong when you exit it with too little digits.

The sample is here: https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:65a89301-3c27-411d-a9f6-71c4b22b19d...

Your double messages probably come from explicit alerts or may have been incurred via the actionbuilder - I don't know your form, I can only guess.

Answers (2)

Answers (2)

Avatar

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 2

08-05-2021

I thought I fixed this issue, but just found out it's not fixed.  I need more assistance.  If I enter 10 characters like this...(123)34567, the both error messages appears as stated below and enters the wrong information.  How can I get my form to recognize the "non" digits, like the brackets and stop the entry?

Thank you.

Avatar

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 2

08-05-2021

This worked.  The reason why the double warning message was appearing was because the "error box" in the Validation Script Message section was checked.  When I unchecked it, the second warning message went away.  Thank you.