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

Textbox value

Hi
This feels silly as I am writing it but how on earth do you set the value of a ejMaskEdit control after it has been created.  There appears to be a get stripped value function but nothing to set the value.

I have tried the following and several variants of it but no luck.  I can get the value populated on load but sometimes need to manually set them once the controls are created.

    var control = $('#' + controlId);
    if (control) {
        var ejMaskEdit = control.data('ejMaskEdit');
        if (ejMaskEdit) {
            ejMaskEdit.model.value = value
        }
    }

Regards

Jon

3 Replies

AB Ashokkumar Balasubramanian Syncfusion Team October 6, 2016 01:20 PM UTC

Hi Jon, 
 
Thanks for using Syncfusion Products. 
 
We have checked your code block. It seems you are using the incorrect syntax to set the value for MaskEdit control. 
 
Please refer the correct syntax below. 
 
[Script] 
              var ejMaskEdit = $("#maskedit").data('ejMaskEdit'); 
              var value = "4242422424"; 
              ejMaskEdit.option({ value: value}) 
 
We have prepared the sample based on your requirement (“To set the value to MaskEdit control”). Please find the below link, 
 
 
To know more about the api configuration, please refer the below link. 
 
Please let us know if you have further queries. 
 
Regards, 
Ashokkumar B. 



JE Jon E October 6, 2016 01:31 PM UTC

Great, many thanks for that clarification.  

I take it that generally changing values in the controls after they are initialised is best done like that rather than x = y?


AB Ashokkumar Balasubramanian Syncfusion Team October 7, 2016 12:36 PM UTC

Hi Jon, 
 
Thanks for your update. 
 
We are glad to know that the given solution works for you. Please let us know if you need any further assistance.  
 
Regards, 
Ashokkumar B.

Loader.
Up arrow icon