Home  |  About  | Last |  Submit  |  Contact
AllQuests.com



Previous Question:  invalid agrument error  JavaScriptNext Question:  Gunna go get job  General Discussion Board
Question jQuery plugin number picker ( SitePoint Forums JavaScript )
Updated: 2010-08-02 23:05:33 (1)
jQuery plugin number picker

Hi.
Is there out there a jquery plugin
for inserting price in a
input field (I mean like date picker) ?

Bye.

Answers: jQuery plugin number picker ( SitePoint Forums JavaScript )
jQuery plugin number picker

JavaScript Code:
$(function() {
    var options = [1,2,3,4,5,6,7,8,9,0,'.'];
    var html = '<ul class="number-picker">';
    for(var i = 0, len = options.length; i < len; i++){
        html += '<li>'+options[i]+'</li>';
    }
    html += '</ul>';
 
    $('#price').attr('disabled', true);
    $('#price-element').append(html);
    $('.number-picker li').click(function(){
            var digit =  $('#price').val()+$(this).text();
            $('#price').val(digit);
        }
    )
});

my xhtml
HTML4Strict Code:
<dt id="price-label"><label for="price" class="required">Price :</label></dt>
<dd id="price-element">
<input type="text" name="price" id="price" value="" maxlength="7" /></dd>

It could be an idea
quick and easy

whisher

Previous Question:  invalid agrument error  SitePoint Forums  JavaScriptNext Question:  Gunna go get job  SpeedGuide.net Broadband Community  General Discussion Board

- Source: jQuery plugin number picker SitePoint Forums JavaScript
- Previous Question: invalid agrument error SitePoint Forums JavaScript
- Next Question: Gunna go get job SpeedGuide.net Broadband Community General Discussion Board