I have the following code for a submit button my page: The html markup is:
<td align="Right"><input type="submit" value="Add Driver" ></td>
and the jquery is:
$( "input[type=submit]" ).button().click(function( event ) {
event.preventDefault();
});
How would I add a ui icon to the above, specifically the ui-icon-circle-plus
You can change your HTML like this:
<button type="submit">
Add Driver
</button>
And then update your script like this:
$('button[type=submit]').button({icons: {primary: 'ui-icon-circle-plus'}}).click(function (event) {
event.preventDefault();
});
Demo: http://jsfiddle.net/mh5Pu/
Look at the examples on http://jqueryui.com/button/#icons (specifically the icons).
Instead of using a submit input, try using a button.
Here's a modified version of the icon only button with ui-icon-circle-plus:
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" role="button" aria-disabled="false" title="Button with icon only">
<span class="ui-button-icon-primary ui-icon ui-icon-circle-plus"></span>
<span class="ui-button-text">Button with icon only</span>
</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With