2 Replies Latest reply: Feb 16, 2012 6:18 AM by srinivas rao RSS

rich:InputNumberSpinner

srinivas rao Newbie

I want to put the '00' in the inputNumberSpinner instead of '0' so please provide the help


Thanks





regards
Srinivas.Gunda

  • 1. Re: rich:InputNumberSpinner
    Tim Evers Master

    This is kinda hacky but it sorta works. Disregard the javascript if you don't need the increment to go 01, 02, 03 etc.


    I'm sure there's a better way of doing this but I didn't have enough time to investigate anymore. Oh if 01,02 don't work when you submit the page you may need to write your own converter too.


    <rich:inputNumberSpinner
        id="numSpin" 
        minValue="00" 
        value="00" 
        step="1"
        onchange="updateSpinnerValue(this);"/>
    <script>
        function updateSpinnerValue(element) {
            var input = element.spinner.content.firstChild;
            if (input.value.length == 1) {
                input.value = "0"+input.value;
            }
        }
    </script>
    

  • 2. Re: rich:InputNumberSpinner
    srinivas rao Newbie

    thanks for giving reply it works fine............