!function($){$(document).ready(function(){var $form_instance=$("form.course-search"),$state_field=$form_instance.find("select.state"),$education_field=$form_instance.find("select.education"),dropdown_default="";$education_field.find("option").each(function(){dropdown_default+='
'+$(this).text()+""}),$state_field.on("change",function(){var $dropdown=$education_field.next(".dropdown"),$dropdown_select=$dropdown.find(".dropdown-select"),education_field_default=$education_field.html(),data={action:"wds_get_state_pages",state_val:$(this).val(),ajax_nonce:ajax_object.ajax_nonce};$.post(ajax_object.ajax_url,data,function(response){$education_field.html(education_field_default),$dropdown_select.html(dropdown_default),$.each(response.data,function(index,section){$.each(section,function(key,value){"label"==value?($education_field.append($("").text(key)),$dropdown.find(".dropdown-select").append(''+key+"")):($education_field.append($("").attr("value",value).text(key)),$dropdown.find(".dropdown-select").append(''+key+""))})})},"json")}),$form_instance.submit(function(event){$(this).find('[name="state"]').val("")})})}(jQuery);