Hello,
I don't know if EM can work.
But, with javascript:
First make a date with a date question, if you format is dd-mm-yy then:
Something like that to put the age in QQ:
<script type="text/javascript">
function AgeFromBirth(birthdate,QQ) {
aBirthDate=birthdate.split('-');
if(aBirthDate.length == 3){
birth = new Date(aBirthDate[2], aBirthDate[1] * 1 - 1, aBirthDate[0]);
years = Math.floor((now.getTime() - born.getTime()) / (365.25 * 24 * 60 * 60 * 1000));
}
$("#question"+QQ+" input.txt").val(years);
}
$(document).ready(function() {
AgeFromBirth({INSERTANS:sssXgggXqqq},212);
});
</script>If date of birth is in the same page, the a
$("#questionQDATEOFBIRTHnumber input.date").blur(function(){AgeFromBirth($(this).val(),212);});ca do the tric.
And put this function with workarounds help:
docs.limesurvey.org/tiki-index.php?page=..._etc._in_LimeSurvey_
Denis,
PS: there are surely some error in javascript code, i make it directly in the forum
PS2: calculation was taken here:
pankajlalwani.wordpress.com/2010/08/02/a...ng-javascriptjquery/