Commit 25804992 authored by marcheing's avatar marcheing Committed by Diego de Araújo Martinez Camarinha

Change responsible fields to coffee script

parent 95683620
function responsible_fields(event){
var current_year = new Date().getFullYear();
if(current_year - $('#profile_year').val() < 18) {
$('#responsible_fields').css('display', 'block');
$("#user-responsible-name").prop('required', true);
$("#user-responsible-id-number").prop('required', true);
} else {
$('#responsible_fields').css('display', 'none');
$("#user-responsible-name").prop('required', false);
$("#user-responsible-id-number").prop('required', false);
}
}
$('#profile_year').on('change', responsible_fields);
responsible_fields = (event)->
current_year = new Date().getFullYear()
if current_year - $('#profile_year').val() < 18
$('#responsible_fields').css('display', 'block')
$('#user-responsible-name').prop('required', true)
$('#user-responsible-id-number').prop('required', true)
else
$('#responsible_fields').css('display', 'none')
$('#user-responsible-name').prop('required', false)
$('#user-responsible-id-number').prop('required', false)
$('#profile_year').on('change', responsible_fields)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment