WebgrownSolutions

William J. Familia's Dev Garden

National Identification Textbox (social security)

As part of a new UI library, I have created a National Identification Textbox (social security, social insurance, etc.) in a manner that follows the guidelines found in the Webgrown Solutions UI Manifesto. The National Identification Textbox supports the following features:

The Demo

The Markup

Just a basic input element, with a normal class attribute and some custom data (data-*) attributes to allow feature customization. Once the Script stuff is in place on a website, any page can implement the National Identification Textbox by simply setting the input element's class attribute to "nationalIdentificationTextbox" and setting the desired optional custom data attributes.

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

<div class="form legendLook horizontalFormLayout">
    <div id="hdivFormTest1ConfirmationMessage" class="confirmationMessageWrapper hide"></div>
            
    <label for="txtUsSsn">U.S. Social Security Number:</label>
    <input type="text" id="txtUsSsn" class="nationalIdentificationTextbox" 
        required 
        placeholder="e.g. 123-12-1234"
        data-countryIsoCode="US"
        data-formGroup="formAuthenticate" 
        data-parameterName="singleItem" />

    <label for="txtCaSin">Canada Social Insurance Number:</label>
    <input type="text" id="txtCaSin" class="nationalIdentificationTextbox" 
        required 
        placeholder="e.g. 123-123-123"
        data-countryIsoCode="CA"
        data-formGroup="formAuthenticate" 
        data-parameterName="" />  

    <label for="txtDoCn">Dominican Republic Cédula Number:</label>
    <input type="text" id="txtDoCn" class="nationalIdentificationTextbox" 
        required 
        placeholder="e.g. 123-1234567-1"
        data-countryIsoCode="DO"
        data-formGroup="formAuthenticate" 
        data-parameterName="" />     

    <div class="formButtonWrapper clearFix">
        <input type="submit" class="ajaxFormPost buttonStrong" value="Submit"
            data-formGroup="formAuthenticate" 
            data-serviceRequestUrl="/WebServices/AjaxFormTestClientService.svc/SingleItemTestSubmit" 
            data-successFunction="successFormTest1"
            data-confirmActionMessage=""
            data-processingMessage=""
            data-overlayWindowWhileProcessing="true" />
    </div>
</div>

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 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.