Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all
am working on batch editing inCell edit mode in that while clicking cancel field validators are firing can any help me how to disable that validators for cancel button. I tried this coding but not properly working

Like this I have create save and cancel buttons

HTML
<div class="resource_right_menu_new">
<div>
   <a href="#" id="btnSave">SAVE</a></div>
<div>
  <a href="#" id="btnCancel" > CANCEL</a></div>
</div>


My javascript function
JavaScript
$('#btnCancel').click(function( ) {
   $('#btnCancel').CausesValidation = false;
     var grid = $( "#grdLists" ).data( "tGrid" );
      grid.ajaxRequest( );
  });

I tried the above coding but now also it firing validations. can any help me to get out of this problem
Posted
Updated 24-Jul-12 1:49am
v2
Comments
Sandeep Mewara 24-Jul-12 7:53am    
Did you debug and see the execution flow?

Why couple of lines with ajax request post cancel click?
kevin_ze 24-Jul-12 7:59am    
while clicking on cancel I have to refresh the grid to cancel the changes on grid its refreshing the grid but first it fires the required field validator and then it refreshes the grid

1 solution

try adding class as cancel and mvc3 will automatically take care of it...

class="cancel"
 
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