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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

120635 Sep 29,2015 06:35 AM Sep 30,2015 10:22 AM JavaScript 1
loading
Tags: ejmNumeric
Rakesh Advani
Asked On September 29, 2015 06:35 AM

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

Francis Paul Antony Raj [Syncfusion]
Replied On September 30, 2015 10:22 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;