Reputation: 4021
I am using ASP .Net MVC 4 , razor
on a form , in submit action, i want to set a confirm dialog of javascript. if i click "Ok" post method will be executed. else will not. so i used:
<td ><input type="submit" value="Process" name="btnProcess" onclick="confirm('Proceed?')"/></td>
but after clicking cancel it is executing the controller. How do i do this?
Upvotes: 1
Views: 185
Reputation: 26940
<td ><input type="submit" value="Process" name="btnProcess" onclick="return confirm('Proceed?')"/></td>
Upvotes: 3