WebgrownSolutions

William J. Familia's Dev Garden

Button

As part of a new UI library, I have created a Button feature in a manner that follows the guidelines found in the Webgrown Solutions UI Manifesto. The Button supports the following features:

The Demo

Input (type=submit)

Input (type=button)

Anchor (LinkButton)

Add Item

The Markup

Just some basic button element options (<input type="button">, <input type="submit">, <a>, etc.), with a normal class attribute and some custom data (data-*) attributes to allow feature customization. Once the CSS and Script stuff are in place on a website, any page can implement the Button by simply setting the Button element's class attribute to "button" (or "ajaxFormButton" if using Ajax Form functionality), and setting the desired optional custom data attributes.

That sounds like a DRY solution to me (see UI Manifesto).

<input id="hbtnTest1" type="submit" class="button buttonStrong" value="Add Item"
    data-confirmActionMessage=""
    data-processingMessage="Adding..."
    data-overlayWindowWhileProcessing="false" /> 
<h3>Input (type=button)</h3>
<input id="hbtnTest2" type="button" class="button buttonStrong" value="Add Item"
    data-confirmActionMessage=""
    data-processingMessage=""
    data-overlayWindowWhileProcessing="true"
    onclick="simulatedAjaxOrDhtmlCall1()" /> 
<h3>Anchor (LinkButton)</h3>
<a id="lbtnTest2" class="button buttonStrong"
    data-confirmActionMessage="Are you sure?"
    data-processingMessage="Adding..."
    data-overlayWindowWhileProcessing="true"
    onclick="simulatedAjaxOrDhtmlCall2()">Add Item</a>

The CSS

Not shown to the general public.
        

The Script

Not shown to the general public.
        
blog comments powered by Disqus

In addition to the markup, CSS, and JavaScript code samples found below the demo, the following resources/files are required:

We are processing your request.

loading...
*
Please fix the following issues and then submit again: is required. is not valid. does not match
loading...
mm/dd/yy mm/dd/yy 0 Previous Next ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] Wk false false false h:mm tt Choose Time Time: Hour: Minute: Second: Now Done You have # character(s) remaining.