2
A better solution seems to be to use
button type="button"
like this:
<button type="button" class="btn btn-danger me-1" name="cancel" id="cancel" onClick="history.go(-1);return true;">' . _CANCEL . 'button>
- Clarity: Each button's purpose is explicitly defined by its type attribute (submit, reset, button), making the form's behavior clear at a glance. - Uniformity: Using the same element type for all buttons enhances uniformity, making styling and scripting more predictable. - Ease of Updates: If you decide to add features like tooltips, loading indicators, or other interactive elements, "button" elements offer more flexibility. - "button" elements are also more flexible for styling