Tuesday 15 September 2015

regex - LiveCycle Javascript Function ReferenceError -


I can not figure out what I'm doing wrong in this function for live function to check email function I am The Livecycle console returns an error of "ReferenceError: Not defined emailAddress", even if the function warns or xfa.host.messageBox will fire. Can you tell me why the Global variable email address can not be defined after running through this function? Thanks for your time.

  function Faxmail verification (email address) {var r = New RegExp ("^ [A-Za-z0- 9_ \\ - \\.] + \\ @ test com") ; // Crateville test of current object to see if this new RegExp var result = RTEEt (Email address); If (result == incorrect) {var emailAddress = ""; Warning ("You have entered an invalid email address. \ All email addresses must end in '@ test.com.'", "Email Verification", 4, 0); } Return email address; }; Textfield1.rawValue = fxemailverification (email address);    

email address variable is present only inside the function, but You are trying to use it from outside, it is not out of the realm, not sure what you are looking for, maybe it?

  var emailAddress = ""; Function Faxmail Report (email address) {var r = New Regx ("^ [AZA-ZD-0-9 _ \\ - \\.] + \\ @ test.com"); // Crateville test of current object to see if this new RegExp var result = RTEEt (Email address); If (result == incorrect) {emailAddress = ""; Warning ("You have entered an invalid email address. \ All email addresses must end in '@ test.com.'", "Email Verification", 4, 0); } Return email address; }; Textfield1.rawValue = fxemailverification (email address);    

No comments:

Post a Comment