My application uses “button” html elements for submitting forms. The code is below…
<button class="button save" name="save" type="submit">Apply Changes</button>
However, I’m finding that sometimes I need to click the button a few times in order to get it to submit. Is this a known issue with the html button object?
Can I apply an onclick handler to insure the button fires consistently on first click?
Browsers will react differently to the
<button>tag, especially Internet Explorer. If you are using this button for an HTML form,<input type="submit">is the way to go since it’s fully supported by major browsers.Both
<button>and<input>tags can provide a rich content if CSS attributes are done correctly, despite what you read on the internet. I always go with<input>, it’s safer.