Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.


JavaScript
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);
}
}
Posted
Updated 28-Dec-11 20:21pm
v3

if we add Page.IsValid =false validation properties will not work.........
 
Share this answer
 
If you Give Page.IsValid=false It(Script) will not work
 
Share this answer
 
Comments
Rupa1 29-Dec-11 4:40am    
not in java script,it will not work normal validations also...if we keep like :)(Page.IsValid=false )
i didnt understood your question..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900