$(document).ready(function() { var actualtime = new Date(); $('#tzd').val(actualtime.getTimezoneOffset()+120); $("#almostdone").click(function(event) { $('.step1 input').each(function() { $(this).nextAll(".feedback").first().hide(); $(this).removeClass('missing'); }); musthave=true; $('.step1 input').each(function() { if($(this).val()=="" && $(this).prop('required')) { $(this).addClass("missing"); $(this).nextAll(".feedback").first().show(); musthave=false; } }); if(musthave) { $(".step1").toggleClass( "hideme" ); $(".step2").toggleClass( "hideme" ); } return true; }); $("#back").click(function(event) { $(".step1").toggleClass( "hideme" ); $(".step2").toggleClass( "hideme" ); }); //$("#EventType").click(function(event) { // $("#EventLogo").toggleClass( "hideme" ); //}); $(".step1 input, .step2 input").keyup(function() { if($(this).val()!="" && $(this).prop('required') && $(this).is(":visible")) { $(this).next().hide(); $(this).removeClass('missing'); } }); $("#createit").click(function(event) { $('.step2 input').each(function() { $(this).next().hide(); $(this).removeClass('missing'); }); musthave=true; $('.step2 input').each(function() { if($(this).val()=="" && $(this).prop('required')) { $(this).addClass("missing"); $(this).next().show(); musthave=false; } }); var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i if(filter.test($("#email").val())) { // Email NS check jQuery.ajaxSetup({async:false}); var ns_check = false; $.get( "/php/checkdns.php", { domain: $("#email").val().split('@').pop() } ) .done(function(check) { if(check=="true") ns_check = true; }); jQuery.ajaxSetup({async:true}); if(!ns_check) { $(".email").addClass("missing"); $(".email .feedback").show(); return false; } if(ns_check && musthave) { $('#createit', this).attr('disabled', 'disabled'); return true; } } else { $(".email").addClass("missing"); $(".email .feedback").show(); musthave=false; } return false; }); var EventSubCategories = { musicfestival : [ { sql: "classical", human: "Classical" }, { sql: "electronic" , human : "Electronic" }, { sql: "folk" , human : "Folk" }, { sql: "pop" , human : "Pop" }, { sql: "rock" , human : "Rock" }, { sql: "religious" , human : "Religious" }, { sql: "world" , human : "World Music" } ], concert : [ { sql: "pop" , human : "Pop" }, { sql: "rock" , human : "Rock" }, { sql: "hiphop" , human : "Hip-Hop" }, { sql: "rb" , human : "R&B" }, { sql: "electronic" , human : "Electronic" }, { sql: "countrymusic" , human : "Country" }, { sql: "jazz" , human : "Jazz" }, { sql: "reggie" , human : "Reggie" }, { sql: "latin" , human : "Latin" }, { sql: "classical" , human : "Classical" }, { sql: "folk" , human : "Folk" } ], sportevent : [ { sql: "football" , human : "Football" }, { sql: "basketball" , human : "Basketball" }, { sql: "cricket" , human : "Cricket" }, { sql: "tennis" , human : "Tennis" }, { sql: "americanfootball" , human : "American Football" }, { sql: "olympic" , human : "Olympic" }, { sql: "athletics" , human : "Athletics" }, { sql: "swimming" , human : "Swimming" }, { sql: "rugby" , human : "Rugby" }, { sql: "formula1" , human : "Formula 1" }, { sql: "golf" , human : "Golf" }, { sql: "motorgp" , human : "Motor GP" }, { sql: "baseball" , human : "Baseball" }, { sql: "icehockey" , human : "Icehockey" }, { sql: "boxing" , human : "Boxing" }, { sql: "wrestling" , human : "Wrestling" }, { sql: "gymnastics" , human : "Gymnastics" }, { sql: "wintersports" , human : "Winter Sports" }, { sql: "martialarts" , human : "Martial Arts" }, { sql: "extremesports" , human : "Extreme Sports" }, { sql: "cycling" , human : "Cycling" } ], filmfestival : [ { sql: "international" , human : "International" }, { sql: "national" , human : "National" }, { sql: "animation" , human : "Animation" }, { sql: "shortfilm" , human : "Short films" }, { sql: "documentary" , human : "Documentary" }, { sql: "independent" , human : "Independent" } ], gathering : [ { sql: "demonstration" , human : "Demonstration" }, { sql: "march" , human : "March" }, { sql: "protest" , human : "Protest" } ] } $('#EventType').on('change', function(event) { let selectedType = $('#EventType').val(); if(selectedType != "private") { if($('#EventSubType:hidden')) { $('#EventType').addClass("width49"); $('#EventSubType').addClass("width49"); $('#EventSubType').show(); } if($('#EventEmailArea:hidden')) $('#EventEmailArea').css("display","grid"); $('#EventSubType').empty(); if(selectedType != ""){ var subCategory = EventSubCategories[selectedType]; console.log(subCategory.length); for (var count = 0; count < subCategory.length; count ++) { $('#EventSubType').append($('