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

ClearPromptChar for MaskedTextBoxFor not working

2 Answers 71 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Tomáš Víšek
Top achievements
Rank 1
Tomáš Víšek asked on 04 Oct 2018, 01:47 PM

Hi,

 

I discovered a problem with ClearPromptChar configuration. When I set ClearPromptChar to true, I expect that the mask signs should not be in the output. I.e. when I define mask 000-000 and insert 123-456 into the MaskedTextBoxFor the output should be 123456. I would like to avoid removing "-" manually.

Example available at: http://dojo.telerik.com/aTEROJIG/3

Should it work as I expected or I misunderstood?

 

Thanks,

   Tomas.


2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 08 Oct 2018, 01:05 PM
Hi Tomas,

The "clearPromptChar" property determines whether the widget will replace the prompt characters with spaces on blur. From what I understand, you need the raw value, which could be retrieved with the "raw" method:
$("#maskedtextbox").kendoMaskedTextBox({
  mask: "000-000",
  clearPromptChar: true
});
   
  function onInsertClick(e) {
      var UZ = $('#maskedtextbox').data("kendoMaskedTextBox").raw();
    $('#cisloDavkyTextBox').val(UZ)
      }

Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Tomáš Víšek
Top achievements
Rank 1
answered on 09 Oct 2018, 03:30 PM

Hi,

thanks a lot, that's what I needed!

   T.

Tags
MaskedTextBox
Asked by
Tomáš Víšek
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Tomáš Víšek
Top achievements
Rank 1
Share this question
or