Below is regExp for a Date. Can someone please provide more information on what would be the right code for the Time.
Thank you,
var
regExpDate = /^\d{4}-\d{2}-\d{2}$/;
var
vMatched = this.rawValue.match(regExpDate);
var
sDate = this.rawValue;
var
oDate = util.scand("yyyy-mm-dd", sDate);
if
((!vMatched)||(oDate == null)){
this.rawValue
=null;
xfa.host.setFocus(
this);
}
Solved! Go to Solution.
Views
Replies
Total Likes
Views
Replies
Total Likes
Have you tried:
regExpTime = /^\d{1,2}\:\d{2}$/;
Views
Replies
Total Likes
I am missing something. With the code below, and display pattern set to time{KK:MM} and edit pattern set to time{KK:MM}|time{KKMM}|time{KK MM}|time{KK-MM}|time{KK.MM.SS}|time{KK.MM}|time{KK,MM}, still my time field does not accept any time format like 12:30 or 12:15. .
regExpTime
= /^\d{1,2}\:\d{2}$/;
var
vMatched = this.rawValue.match(regExpTime);
var
sTime = this.rawValue;
var
oTime = util.scand("HH:MM", sTime);
if
((!vMatched)||(oTime == null)){
this.rawValue
= null;
xfa.host.setFocus(
this);
}
Views
Replies
Total Likes
var
regExpTime = /^\d{1,2}\:\d{2}$/;
var vMatched = this.rawValue.match(regExpTime);
if (!vMatched){
this.rawValue
=null;
xfa.host.messageBox("message")l
xfa.host.setFocus(
this);
}
It works. Thank you so much.
Views
Replies
Total Likes
Views
Likes
Replies