Alpha validation


hi,

 

how validate user entered data whether alphabetic or numeric...

 

other alphabets,an alert should shown user.

 

regards,

 

manjula

you can use numeric fields force numeric data capture only. alternatively, can use regular expressions force numeric or alpha data capture on text fields. attached uses following regular expressions:

 

 

// form1.page1.tf-numeric-only::exit - (javascript, client)


 

 

if (!(this.isnull)) {

  var tf = this.rawvalue;

  // \d match character not in range 0 - 9

  var regexp = /\d/;

  if (regexp.test(tf)) {

    xfa.host.messagebox("the field must numeric.","validation",1);

  }

}


 

// form1.page1.tf-alpha-only::exit - (javascript, client)


if (!(this.isnull)) {

  var tf = this.rawvalue;

  // \d match character in range 0 - 9

  var regexp = /\d/;

  if (regexp.test(tf)) {

    xfa.host.messagebox("the field must alpha.","validation",1);

  }

}

 

steve



More discussions in LiveCycle Forms


adobe

Comments