View Full Version : jQuery UI - styling a button

11-18-2010, 05:21 PM
ok, I am using jQuery UI http://jqueryui.com

I have it all working but I wanted to style my form button

I am using this:

<button id="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">A button element</span></button>

that styles it, but doesn't work as I need it to be a form button?!

Please help?!


11-19-2010, 12:08 AM
please help

Old Pedant
11-19-2010, 12:28 AM
Do you mean it's not a SUBMIT button? That depends on the browser you are using.

But you can easily ensure that it acts as a submit button:

<button type="submit" ...>....</button>

Or if I misunderstood you and you do *NOT* want the button to submit, just make it

<button type="button" ...>....</button>

It's a good idea to specify this, in any case, as MSIE 7 and below default differently than other browsers.

11-19-2010, 10:19 AM
great thanks, and if I want the button to link somewhere?

11-19-2010, 11:12 AM
Make it as type=button and then attach an onclick handler that sets the location.href to some url.