我无法弄清楚我在使用这个函数来检查电子邮件地址时做错了什么。Livecycle 控制台返回“ReferenceError:未定义电子邮件地址”错误,即使该函数将触发警报或 xfa.host.messageBox。你能告诉我为什么在运行这个函数后无法定义全局变量 emailAddress 吗?谢谢你的时间。
function fxemailverification(emailAddress) {
var r = new RegExp("^[A-Za-z0-9_\\-\\.]+\\@test.com");
// Test the rawValue of the current object to see if it matches the new RegExp
var result = r.test(emailAddress);
if (result == false) {
var emailAddress = "";
alert("You have entered an invalid Email address. \nAll email addresses must end in '@test.com'.", "Email Verification", 4, 0);
}
return emailAddress;
};
textfield1.rawValue = fxemailverification(emailAddress);