ExtensionMethod.NET Home of 823 C#, Visual Basic, F# and Javascript extension methods

addCalendarToTextBox()

Add Date Picker to Text Box

Source

function addCalendarToTextBox() {
    $('.calendar').datepick({
        showOn: 'both'
        , buttonImage: imageIcon
        , buttonImageOnly: true
        , yearRange: '-30:10'
        , hideIfNoPrevNext: true
    }).width(80);
}

Example

just add class='calendar' to your text box element

Author: John D. Sanders

Submitted on: 15 jan 2014

Language: JavaScript

Type: TextBox

Views: 2775