I have faced a problem with the submit button in mvc34 razor view.I have added a row dynamically in jQuery to webgrid which contains one submit button to insert the row data in db.I want to validate the textbox of the row if empty pop up a alert and stop the action. When I tried to write like this
$('#btnInsert').click(function()
{
if ($('#tbStudentName').val() == '') {
alert('Please enetre!');
return false;
}
});
This Event is not at all firing in jQuery.Can we call the dynamically created submit button client click event in jQuery like above? I have written like this
function InsertClick(button) {
if ($('#tbStudentName').val() == '') {
alert('Please enetre!');
return false;
}
}
but still the Controller Side FormAction method is firing. Could any one tell me the solution to prevent the action in server side?