I have 3 fields, day, month, year, and a function to join them. The problem is I need to prepend a zero to the day field if it doesn't have one and is 1 to 9. so what I'm getting for 1st August is
1/08/2015 but what I need is 01/08/2015
So I've been trying variations on str_pad("different stuff attempted", 10, '0', STR_PAD_LEFT)
In both the first line with the var dd and the last line with the r_date with no luck
function join_date()
{
var dd = document.getElementById('day').value;
var mm = document.getElementById('month').value;
var yy = document.getElementById('year').value;
document.getElementById('dr_date').value = (('0'+dd).slice(-2)+"/"+mm+"/"+yy)
}