[英]Javascript validation for an Adobe Form Field - Email Cc (Multiple email inputs)
[英]Adobe livecycle form validation email, numbers etc.
我不熟悉Adobe live cycle,但是我正在创建一个需要验证的表单。 当用户输入电子邮件时,我将使用此脚本来验证我的电子邮件(该电子邮件可以在其他PDF中使用),但Live Cycle由于某种原因无法读取它。 它没有读取我的任何验证。 救命?
<script>
var str = this.getField("1-3f-email").value;
if (str != "") {
var regExp = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|ca|mx|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\b$/;
if (!regExp.test(str)) {
app.alert("Please ensure email address is valid");
resetForm(["1-3f-email"]);
}
}
</script>
var r = new RegExp(); // Create a new Regular Expression Object. r.compile("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[az]{2,3}$","i");// Set the regular expression to look for an email address in general form. var result = r.test(this.rawValue); // Test the rawValue of the current object to see if it fits the general form of an email address. if (result == true) // If it fits the general form, true; // all is well. else // Otherwise, false; // fail the validation.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.