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

format licence number problem - lead zero

Avatar

Avatar
Validate 1
Level 1
WhatCindy
Level 1

Like

1 like

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
WhatCindy
Level 1

Like

1 like

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
WhatCindy
Level 1

10-08-2015

Hi All,

I have tried to fix my coding but it is not successful. Please help.

when I open the for the errors message is displayed this rawValue = null;

this field allows enter numeric only - max: 24 digits, allow enter from 19 digits up to 24 digits.

exit event

if(this.rawValue.length==0)

this.rawValue.length=0;

 

if(this.rawValue.length!=0){

if (this.rawValue.length =="19")

 

  // cancel the change

  this.rawValue =this.rawValue +"00000" 

 

  else if (this.rawValue.length =="20")

 

  // cancel the change

  this.rawValue =this.rawValue +"0000" 

 

   else if (this.rawValue.length =="21")

 

  // cancel the change

  this.rawValue =this.rawValue +"000" 

 

   else if (this.rawValue.length =="22")

 

  // cancel the change

  this.rawValue =this.rawValue +"00" 

 

   else if (this.rawValue.length =="23")

 

  // cancel the change

  this.rawValue =this.rawValue +"0" 

validator.validateRollNumber(xfa.event)

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++

//function from object script document

function validateRollNumber(evnt)

{

var pattern = /^[0-9]{19,24}$/;

  

if(evnt.target.rawValue!=null)

 

// if user's input does NOT match the pattern, display a validation message

if(!evnt.target.rawValue.match(pattern))

 

evnt.target.rawValue="";

}

Thanks,

Cindy

Accepted Solutions (0)

Answers (0)