Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Need assistance writing a JavaScript code for validating the length of transit numbers

$
0
0

var transit = this.getField("bankNumber").valueAsString;

var transitLength = transit.length;

if (transit.length !===  5)

{

xfa.host.messageBox("The transit number has to be 5 digits.")

}

 

I'm using Adobe proffesional 7.0, as I'm not allowed to update to a newer version for compatibility reasons.

 

This code won't even run, I'm not sure why, and it is under the validate event heading.

 

I am new to JavaScript so I could be making a really silly error.

 

-Brett

 

As a side note the object of this code is to alert the user that the transit number is not 5 digits. All banks here in Canada have 5 digit transit numbers.


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>