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

Masked textbox not guaranteed

4 Answers 165 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Tayger
Top achievements
Rank 1
Iron
Tayger asked on 14 Mar 2016, 08:24 PM

Hello

I wanted to let you know that you can "cheat" masked textbox. I created a masked textbox allowing hours, minutes and seconds in format: hh:mm:ss while "mm" and "ss" cannot be higher than 59 as it makes sense:

$("#eventobjecttime").kendoMaskedTextBox({
mask: "00:~0:~0",
value: "00:00:00",
rules: {
"~": /[0-5]/,
}
});

That works fine but if I enter f.e. "05:47:58" (what is fine and allowed by set rule), set the cursor behind the "05" (hours) and press DEL left key (as I want to delete the "5" the part right (mm:ss) shifts to left. You now see: 04:75:8_ Ooops! I can jump out of the textbox and nothing is complaining. The other way around (f.e. pasting something in between) is possible to. So the masked textbox does not guarantee the user can not override the rules.

Do you have any idea how I can make sure the masked textbox can not be overridden?

4 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 17 Mar 2016, 09:02 AM
Hello Tayger,

I apologize for the delayed response.
 
This is indeed a bug in the MaskedTextBox, it has been logged and you can expect it fixed in a future release. You can track it here:

https://github.com/telerik/kendo-ui-core/issues/605

Unfortunately, there is no quick fix or workaround that I can offer. I am sorry for any inconvenience this might cause.

Regards,
Dimiter Topalov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Tayger
Top achievements
Rank 1
Iron
answered on 20 Mar 2016, 09:24 PM

Hi Dimiter

Thats ok, I can live with the fact it will be fixed in a future release.

0
Tayger
Top achievements
Rank 1
Iron
answered on 21 Mar 2016, 04:03 PM

You also may add (as bug) that the given mask and rule:

mask: "00:~0:~0",
rules: { "~": /[0-5]/ }

also allows to jump out with a value like "00:00:__"
This is imho not ok due mask "0" does not allow spaces, while "9" does accept space values: http://docs.telerik.com/kendo-ui/api/javascript/ui/maskedtextbox#configuration-mask

 

0
Dimiter Topalov
Telerik team
answered on 23 Mar 2016, 12:33 PM
Hi Tayger,

Thank you for reporting this issue, it will be added as an issue and fixed accordingly.

Regards,
Dimiter Topalov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MaskedTextBox
Asked by
Tayger
Top achievements
Rank 1
Iron
Answers by
Dimiter Topalov
Telerik team
Tayger
Top achievements
Rank 1
Iron
Share this question
or