如何验证器启用/禁用文本框 [英] how to validatator enable/disable textbox

查看:64
本文介绍了如何验证器启用/禁用文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何验证文本框.
我有一个按钮和一个复选框
当我选中复选框时,它禁用了一些文本框,否则全部启用
以下是Java脚本函数
其工作正常,但在服务器端
Page.IsValid条件为false,所以我的文本值如何保存,请告诉我它的紧急值.


how to validate text box.
i have one button and one checkbox
when i check the checkbox then it disable some textbox otherwise all enable
below is java script function
its working fine but in server side
Page.IsValid condition false so my text value how to save please tell me its urgent.


function disable() {
    if (document.getElementById('<%=chkAEntry.ClientID %>').checked) {
        ValidatorEnable(document.getElementById('<%=rfvFixtureDate.ClientID %>'), false);
        ValidatorEnable(document.getElementById('<%=rfvVessel.ClientID %>'), true);
        ValidatorEnable(document.getElementById('<%=rfvDPort.ClientID %>'), true);
        ValidatorEnable(document.getElementById('<%=rfvDwt.ClientID %>'), false);
        ValidatorEnable(document.getElementById('<%=rfvLPort.ClientID %>'), false);

        ValidatorEnable(document.getElementById('<%=rfvLayCan.ClientID %>'), false);
        ValidatorEnable(document.getElementById('<%=rfvCharterer.ClientID %>'), false);
        ValidatorEnable(document.getElementById('<%=rfvWSRate.ClientID %>'), false);
        ValidatorEnable(document.getElementById('<%=rfvddlFixtureStatusID.ClientID %>'), false);

}
else {

    ValidatorEnable(document.getElementById('<%=rfvFixtureDate.ClientID %>'), true);
    ValidatorEnable(document.getElementById('<%=rfvVessel.ClientID %>'), true);
    ValidatorEnable(document.getElementById('<%=rfvDPort.ClientID %>'), true);
    ValidatorEnable(document.getElementById('<%=rfvDwt.ClientID %>'), true);
    ValidatorEnable(document.getElementById('<%=rfvLPort.ClientID %>'), true);

    ValidatorEnable(document.getElementById('<%=rfvLayCan.ClientID %>'), true);
    ValidatorEnable(document.getElementById('<%=rfvCharterer.ClientID %>'), true);
    ValidatorEnable(document.getElementById('<%=rfvWSRate.ClientID %>'), true);
    ValidatorEnable(document.getElementById('<%=rfvddlFixtureStatusID.ClientID %>'), true);
}
}

推荐答案

如果我们添加Page.IsValid = false,则验证属性将不起作用.........
if we add Page.IsValid =false validation properties will not work.........


如果您提供Page.IsValid = false,它(脚本)将无法工作
If you Give Page.IsValid=false It(Script) will not work


我不明白您的问题..


这篇关于如何验证器启用/禁用文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆