Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
There are two tabs named register and planning in one page. And in Register page I did ASP.NET MVC validation for some Text boxes.And while clicking on submit button of that page I am getting correct validation But when I am selecting on Planning tab there I have not done any validation but while clicking on submit button that time I am getting validation error message in the above of the page.And in Planning page I don't give validation still i am getting validation error message.For hiding I validation I used below code but it is not working.
JavaScript
$(document).ready(function () {
       $(#tabs).bind('change', function () {
           var value = $(this).val();
           alert(value);
           if (value == "tabs-1";) {
               $("#strWorkOrderPONo").rules("remove"); 
           }
           if (value == "tabs-2"{
               $("#strWorkOrderPONo").rules("add", "required");
           }
           return false;
       });

   });
strWorkOrderPONo is the text box id ,here i did validation
tabs-1 for Register and tabs-2 for Planning
Posted
Updated 3-Jul-13 1:15am
v3
Comments
Sergey Alexandrovich Kryukov 10-Jul-13 2:25am    
You are not trying to hide anything. Where?
What do you mean by "delete validation"? There is no such thing...
—SA

1 solution

Please see my comments to the question. So, what's wrong with jQuery .hide() and .show()? Please see:
http://api.jquery.com/hide/[^],
http://api.jquery.com/show/[^].

—SA
 
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