Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
hewstone

Veteran
Registered:
Posts: 118
Reply with quote  #1 
I have a text box where a user input a date. I have a mask that will analyse the field and determine if its in the correct format however will still let the user continue with the wrong value. Is there a better solution to this?

function isDate(field) {
   var value = eworkGetField (field);
   var datePat = /^(\d{1,2})(\/|)(\d{1,2})(\/|)(\d{4})$/;
   var matchArray = value.match(datePat); // is the format ok?
   if (matchArray == null) {
             alert("Please enter date as dd/mm/yyyy");
             return false;
   }
   return true;
}
0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #2 
How about using a date field in place of the text field?

If you want to use the text field then you will also need to check it before you submit the form

__________________
Your best practice does not conform with my best practice.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!