RegularExpressionValidator和JQuery Dialog在回发时崩溃

时间:2012-05-18 19:56:17

标签: jquery asp.net validation

一开始,没有验证器,所有工作正常

Web用户控件有一个按钮,可以在Jquery PopUp对话框中打开Panel。该面板有一些TextBoxes。

然后是RegularExpressionValidator,我很生气

我将RegEx Validators添加到我的多行文本框中,以确保最大长度。它们确实有效,但当我关闭JQuery Dialog并再次尝试打开它时,会出现错误:“无法读取null的属性值”。这是方式:

关闭对话框时:

$("#" + PanelClientId)        
        .dialog({
            autoOpen: false,            
            hide: tipoHide,
            modal: true,
            title: titulo,
            width: ancho,
            height: alto,
            close: function(ev, ui) { $(this).remove();}
            });    

Validator控件为null,但客户端验证例程触发并失败

function ValidatorGetValue(id) {
    var control;
    control = document.getElementById(id);
    if (typeof(control.value) == "string")

因为控制是空的,正如我所说。

请帮帮我

我希望我的英语能力很差。请帮我解决这个问题。我正在考虑在验证之前添加客户端事件,然后将ControlToValidate分配给我的验证器,但到目前为止,我还无法添加在验证之前执行的任何事件。

所以家人,非常感谢您花时间阅读本文并获得宝贵的帮助。

这是我的验证码:

<asp:TextBox runat="server" ID="txtJustificacionSpeaker" TextMode="MultiLine" Wrap="true"
    Rows="4" Width="90%" CssClass="TextoMultilineaScrollAuto"></asp:TextBox>
<asp:RegularExpressionValidator id="revJustificacionSpeaker" runat="server"
        ErrorMessage="*" ToolTip="La justificación no puede exceder 2000 caracteres" ValidationExpression="^([\S\s]{0,2000})$" ControlToValidate="txtJustificacionSpeaker" />

0 个答案:

没有答案
相关问题