The cat is about to go to work in the fifth day of winter. Release it early. If there is a bug, leave a message.
Please keep the copyright statement in the JS file. Thank you!
The remarks in JS are not removed to facilitate mutual communication.
1. Plug-in parameter description
The jquery datetimemask date mask plug-in provides perfect control over Date input. Currently, it supports five mask formats and is successfully debugged under ie6.0 and firefox3.0. This plug-in uses the idea of configuration information, mainly including the following configuration parameters
Safemodel: True, // in safe mode, it cannot be pasted or dragged.
Masktype: "3", // mask type, currently there are 5 types
Isnull: false, // whether all values can be 0
Lawlessmessage: "Your input format is incorrect", // when the input date is invalid and the focus is lost, the plug-in will automatically display this error message to restore the original value.
Onlycontrolkeydown: false, // only controls the input. An invalid date is allowed.
Focuscssname: "", // gets the focus Style
Isnow: false, // whether to obtain the current date
Ismonthstart: false, // whether to obtain the first day of the current month
Whenfocus: function () {}, // callback function when the focus is obtained. No return value.
Whenblur: function () {return true;} // callback function when the focus is lost. Return ture indicates that the extra verification is successful; return false: restores to the previous value.
2. jquery datetimemask date mask plug-in demonstration
The following is a real form, not an image. You can test it directly.
3. server-side controls encapsulated by this plug-in
See my previous articleArticle, With an animated demonstration
The jquery datetimemask date mask plug-in will be released soon and will be presented to friends in the garden as a New Year's Eve!
4. Download the plug-in
Jquery datetimemask1.0
5. features not yet implemented
Because Firefox does not support ondragenter and onpaste, The safemodel attribute is not supported in Firefox.