0
我正在使用AJAX Cascading下拉列表,但想要添加事件验证,例如比较验证器。如何验证AJAX级联下拉列表
由于级联下拉列表要求页面事件验证被禁用,最好的方法是进行验证?
感谢
安迪
验证尝试: 我曾尝试使用它调用一个JavaScript函数的自定义的验证,但它似乎是捡了控制。我收到以下错误Microsoft JScript runtime error: Object required
function ValidateCostCentCat(source, arguments)
{
var countryList = document.getElementById("ddlCategory");
if (null != countryList)
{
var iValue = countryList.options[countryList.selectedIndex].value;
if (iValue == "Select Category")
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
}
}
的成本加幅为自定义的验证是
<asp:CustomValidator ID="valcustCategory" runat="server" CssClass="error" Display="Dynamic" ValidationGroup="DirectHire" ClientValidationFunction="ValidateCostCentCat"
ErrorMessage="Please select a Cost Centre Category from the drop down list provided.">!</asp:CustomValidator>
我已经尝试使用客户端验证自定义验证控件,但我不能让它看到下拉列表。我在上述问题的底部发布了我的代码。 谢谢 – anD666 2010-03-18 11:30:39
查看更新! – 2010-03-18 12:02:57
我已更新以适合您的代码!让我知道! – 2010-03-18 12:23:10