$(document).ready(function() { $(".cookiedel").click(function() { delid=$(this).parent().attr("id"); $.post('/_phpFNC.php', "function=deleteCookie&attribute="+delid, function(data) { if(data=='done') $("#"+delid).hide(); }); }); $(".joinins a").click(function(event) { var ins = $(this).data('code'); $("#joinid").val(ins); }); $(".step1 input").keyup(function() { if($(this).val()!="" && $(this).prop('required') && $(this).is(":visible")) { $(this).next().hide(); $(this).removeClass('missing'); } }); $("#join").click(function(event) { $('.step1 input').each(function() { $(this).next().hide(); $(this).removeClass('missing'); }); musthave=true; $('.step1 input').each(function() { if($(this).prop('required') && $(this).val().length<6) { $(this).addClass("missing"); $(this).next().show(); $(this).next().html("The Event ID is 6 characters long. Please check it.") musthave=false; } }); if(musthave) { $.post('/_phpFNC.php', "function=existEvent&attribute="+$("#joinid").val(), function(data) { if(data=='0') { $("#joinid").addClass("missing"); $(".feedback").show(); $(".feedback").html("There isn’t event linked to this ID. Are you sure it’s correct?"); return false; } else { $(location).prop('href', "/en/"+$("#joinid").val()); return true; } }); } return false; }); }); //# sourceURL=join.js