$(document).ready(function () { updateRegistrationType(); updateProfileType() setTimeout(function () { updateRegistrationType(); updateProfileType() }, 1000); $('input[name=type]').change(function () { updateRegistrationType(); }); $('input[name=profile_visible]').change(function () { updateProfileType() }); }); function updateRegistrationType() { if (parseInt($('input[name=type]:checked').val()) == 1) { //Persoon $('.type_organisation').hide(); $('.type_person').show(); } else { //Organisatie $('.type_organisation').show(); $('.type_person').hide(); } } function updateProfileType() { $('.type_vrijwilligersprofiel').show(); if (parseInt($('input[name=profile_visible]:checked').val()) == 1) { //Persoon $('.type_vrijwilligersprofiel').show(); } else { //Organisatie $('.type_vrijwilligersprofiel').hide(); } } function validateMail(elm, moduleid) { $('#email-notify-inline').addClass("hidden"); var value = $(elm).val(); $.ajax({ url: 'index2.php?moduleid='+moduleid+'&actie=register&var1=ajax_validate_email&var2='+value, success:function(data){ try { data = JSON.parse(data); if(data.result == false) { $.fancybox({ href: '#email-notify', modal: true }); $('#email-notify-inline').removeClass("hidden"); } } catch (err){ console.log(data); console.log(err); } } }); }