【发布时间】:2017-01-22 16:33:49
【问题描述】:
您好我正在尝试使用以下 javascript 来制作移动或固定电话我正在使用 .net webforms,并且我有以下脚本,但它不起作用我已经为我的控件提供了所需的客户端 ID 并在脚本标签之间加载脚本页面底部的其他脚本运行良好,所以不是我的页面有问题,而是这个脚本。
我正在通过以下方式将我的控件附加到脚本
<ClientSideEvents Validation="function(s, e) { OnLandLineValdiate(s, e); }" ValueChanged="function(s, e) { OnUpdateControlValue(s, e); }" />
根据我使用的控制套件,哪些是正确的方法
function OnLandLineValidate(s,e) {
if (!e.isValid)
return;
var landLine = landLineEdit.GetValue();
e.isValid = mobileEdit == null || landLine == null;
e.errorText = "Land Line or Mobile is required."
}
function OnMobileValidate(s, e) {
if (!e.isValid)
return;
var mobileEdit = mobileEdit.GetValue();
e.isValid = mobileEdit == null || landLine == null;
e.errorText = "Land Line or Mobile is required."
}
我想要发生的是,如果填写了mobile,那么如果填写了座机,那么这两个条件都满足了,那么这两个条件也满足了?。
【问题讨论】:
-
你应该修正错别字:我认为应该是Validate,而不是Valdiate,并且在第二个函数中,你写了两次
landLine == null... -
第二个函数没有两次landine==null
-
jQuery 永远是答案
-
这个项目很长一段时间都不允许改变我害怕@RaisingAgent
-
好吧,“不要改变它,如果它至少部分运行” - EA Games
标签: javascript asp.net webforms devexpress