This is a migrated thread and some comments may be shown as answers.

change mask in maskedTextbox

4 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mauro
Top achievements
Rank 1
Mauro asked on 11 Apr 2014, 01:31 PM
Hi guys, I'm trying change the mask property in a component MaskedTextBox in runtime, can I do it? If yes, how?

Thank's

4 Answers, 1 is accepted

Sort by
0
Mauro
Top achievements
Rank 1
answered on 11 Apr 2014, 01:52 PM
Hi.. I found the solution. To do it I needed call setOptions method in maskedTextbox.

Thank's
0
Tayger
Top achievements
Rank 1
Iron
answered on 10 Oct 2017, 07:28 PM

Hello

I'm having the same issue for changing the rules but there is no "setOptions" (also not in documentation). What I've done/tested:

...
var timer = $("#myTimer.data("kendoMaskedTextBox");
timer.options.rules = { <valid rule> };
...

 

I can see the new set rules in console but it doesn't take effect on the MaskedTextBox itself. The initial rules (set while creating the the MaskedTextBox) are still active.

Is there a way to change the rules of a maskedTextBox at runtime?

0
Stefan
Telerik team
answered on 12 Oct 2017, 08:56 AM
Hello, Tayger,

It still can be done with the setOptions method.

It is not documented as it can change only some of the options and it is not fully supported.

I made an example demonstrating this:

https://dojo.telerik.com/UjofOt

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tayger
Top achievements
Rank 1
Iron
answered on 12 Oct 2017, 09:06 AM
Wow, thanks, works well!
Tags
General Discussions
Asked by
Mauro
Top achievements
Rank 1
Answers by
Mauro
Top achievements
Rank 1
Tayger
Top achievements
Rank 1
Iron
Stefan
Telerik team
Share this question
or