We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

If contents of spinner are deleted and user tabs to next field, is spinner re-populated with previous value

<input id="intervalLength" type="text" class="form-control" ej-numerictextbox e-value="60" e-minvalue="0" />

Steps for understanding


step 1 on page load I am getting default values on ej-numerictextbox for ex. 50 
step 2 change value from 50 to 100
step 3 click on tab
step 4 now remvoe value of numbertexbox so numberic textbox is now empty.
step 5 click on tab button 

    So I want value 100 back 


So What i need to is the last inserted values when textbox is empty.

1 Reply

FP Francis Paul Antony Raj Syncfusion Team September 30, 2015 02:22 PM UTC

Hi Rakesh,

Thanks for contacting Syncfusion support.

We can achieve your requirement using focusOut and focusIn event. In focusIn event, we can store the initial value of numeric textbox in the temporary variable. In focusOut, check the textbox value is empty or not. If it is empty, then assign the temporaryvariable value to the textboxvalue. Please refer the following code snippet.


<script>

    $(function () {

        var temp;

        $("#numeric").ejNumericTextbox(

          {

            name: "numeric",

            value: 35,

            minValue: 0,

            width:"100%",

            focusOut: function (e) {

                if(e.value=="")

            this.option("value",temp);

            },

            focusIn: function (e) {

                 temp=e.value;

            }

        });

    })

</script>



To know more about the list of properties, methods, and events available in Numerictextbox, please check the following link

http://help.syncfusion.com/js/api/ejtextboxes

Regards,          

Francis Paul A


Loader.
Live Chat Icon For mobile
Up arrow icon