简体   繁体   English

jQuery Mask输入插件仅设置日期的日期值

[英]jquery mask input plugin only set day value of the date

I am using masked-input-plugin. 我正在使用masked-input-plugin。 Only day part need to change but month and year not need to change. 只需要更改一天的一部分,而无需更改月份和年份。 Here is my code. 这是我的代码。

$("#id").mask("99/06/2017",{placeholder:"dd/mm/yyyy"});

During the input time : it seeing like dd/06/2017 but if I select the input box then remove the cursor(without pressing any number) that time it's show something like as 06/06/2017 在输入时间:看起来像是dd/06/2017但是如果我选择输入框,然后移开光标(不按任何数字),此时它显示为06/06/2017

I have seen this question and answer 我看过这个问题和答案

I am very sorry for my poor English. 我为我的英语不好对不起。

Thanks in advance. 提前致谢。

Make use of 利用

$('#dob').mask("00/00/0000",{placeholder:"dd/mm/yyyy"});

this will solve your problem 这将解决您的问题

At last, I am able to solve the problem. 最后,我能够解决问题。 I am posting this answer, so anybody can get help. 我正在发布此答案,所以任何人都可以得到帮助。

Firstly, extend the mask function of the mask input plugin. 首先,扩展遮罩输入插件的遮罩功能。 Then customized some code to solve this problem. 然后定制一些代码来解决此问题。

For the solution please visit this link For the solution please visit 此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM