Hello All,
I have been going through the Answers Forums trying to work out what I am doing wrong. I have a Form that has a db lookup to return students details. This fills in a Collection that contains Student, DOB and Class. When there is more than one student in the family it creates a new collection.
What I am trying to do is reformat the DOB using JavaScript Regex. The value that is in the db is something like '03/01/2000 00:00:00'. I need to get rid of the '00:00:00'. I created a new field in the group called D.O.B. and gave it the css of D2. The original DOB has a css of D1.
This is the JavaScript that I have been trying..
$(document).ready(function(){
$('.upperCase input').focusout(function() {
$( this ).val($( this ).val().toUpperCase());
});
//*Changes Date of Birth with Regex
var re = new RegExp("(\\d\\d\\/\\d\\d\\/\\d\\d\\d\\d)\\s00:00:00");
$('.D1 input').on('change', function() {
var pm = $(this).val().match(re);
$('.D2 input').val(pm[1]).trigger('change');
});
});
Any hints and assistance will be appreciated.
Jonathan