I am creating an asp web application that can’t use JQuery and uses custom pop up dialogs.
I create a form using:
<% using (Html.BeginForm("Index", "recordsbook", FormMethod.Post, new { id = "SubmitForm" })){%>
I have submit buttons:
<td><input type="submit" value="Next" name="SubmitButton"/></td>
<td><input type="submit" value="Previous" name="SubmitButton" /></td>
<td><input type="submit" value="First" name="SubmitButton" /></td>
<td><input type="submit" value="Last" name="SubmitButton" /></td>
<td><input type="submit" value="Add Record" name="SubmitButton"/></td>
<td><input type="submit" value="Delete Record" name="SubmitButton"/></td>
I want to add a confirmation dialog for the Delete Record SubmitButton. For some reason when I add an onsubmit event to the input it gets skipped. If I change onsubmit to onclick the confirm dialog pops up but the background submit process happens in parallel and refreshes the page.
How can I add the onsubmit confirmation dialog to just the Delete Record submit button.
I believe onclick needs to return false to stop the submission