Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

message (Wrong telephon number

Avatar

Avatar
Validate 1
Level 2
khaldoona993089
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
khaldoona993089
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
khaldoona993089
Level 2

22-12-2018

how cold I creat Nnumericfield that must fill with correct phone number

the correct number that is :

71x-xxx-xxx

or : 77x-xxx-xxx

or  73x-xxx-xxx

If  the number had entered wrongly the message that appear is

( Wrong telephone number !!)

I need the code and where I must put it ??

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

27-12-2018

try this

if(this.rawValue!=null && this.rawValue!=""){

var str = this.rawValue;

var twoDigits = str.slice(0,2);

//xfa.host.messageBox(twoDigits);

if(twoDigits=="71" || twoDigits=="77" || twoDigits=="70" || twoDigits=="73"){

   //xfa.host.messageBox("Right number!");

    if(str.length!=9)

xfa.host.messageBox("Your number should be of 9 digits");

}

else{ xfa.host.messageBox("worng phone number");

}

}

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 2
khaldoona993089
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
khaldoona993089
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
khaldoona993089
Level 2

29-12-2018

yyyeesss!! thanks alot .. this is what I want

Avatar

Avatar
Validate 1
Level 2
khaldoona993089
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
khaldoona993089
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
khaldoona993089
Level 2

26-12-2018

Nathan Brunaugh <nathan@truetechtroubleshooting.com

Nathan Brunaugh gave  me the code ..and it worked perfectly:

========================the code =============

if(this.rawValue!=null && this.rawValue!=""){

var str = this.rawValue;

var twoDigits = str.slice(0,2);

//xfa.host.messageBox(twoDigits);

if(twoDigits=="71" || twoDigits=="77" || twoDigits=="70" || twoDigits=="73"){

   //xfa.host.messageBox("Right number!");

}

else{ xfa.host.messageBox("worng phone number");

}

}

============================

BUT there is another Q :

the correct phone number must includes (9) numbers  ( 7## ### ### )

if you entered more or less than 9 numbers the same message  has been showed

HOW can I right this code and where must put it ??

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

26-12-2018

Have you tried setting patterns in the numeric field/ text field?