I have a textbox in my web forms (ASP.NET Web Forms) which I want to show something like this:
MM/YYYY
I want this "/" in the middle when user is entering the month and year. How should I do this on C#?
I would take a look at the Masked Input jQuery plugin:
https://plugins.jquery.com/maskedinput/
Seems like it would fit nicely for what you need to do.
Implementation looks like this:
jQuery(function($){
$("#date").mask("99/99/9999");
$("#phone").mask("(999) 999-9999");
$("#tin").mask("99-9999999");
$("#ssn").mask("999-99-9999");
});
You can see demos here:
http://digitalbush.com/projects/masked-input-plugin/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With