Click here to Skip to main content
15,891,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 2 textboxes and 2 buttons on the page .1 textbox and 1 button is inside update panel and 1 textbox and 1 button is outside update panel .Now when i press button inside update panel it should only validate textbox inside update panel not the one outside .And when i press button outside update panel it should validate both the text boxes .Please guide me how to do it
Posted
Comments
arathi_suresh 14-Sep-11 2:16am    
Provide your code

C#
function validateForm()
{
    var x = document.forms["myForm"]["Tex1"].value;
    var y = document.forms["myForm"]["text2"].value;
    
    if (x == null || x == "")
    {
        alert("Error");
        return false;
    }
    
    if (y == null || y == "")
    {
        alert("Error");
        return false;
    }
}
 
Share this answer
 
v2
You should create 2 validate function for both button.
on first button validate 1 textbox.
and on other button click validate both textboxes.
 
Share this answer
 
Comments
prejval2006 14-Sep-11 2:25am    
can you provide code of valiadte func

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