$("input[name=formType]").val(''); $('select[name=country]').val('').trigger("change"); $('select[name=destinationselection]').val('').trigger("change"); $('select[name=departselection]').val(''); $('select[name=resortselection]').val(''); $('input[name=propertyname]').val(''); // dates // todo função para uniformizar reposição das datas após pesquisa //reSetDate("", null); var inputDatePicker = "#hoteltonlydatepicker"; if(!$(inputDatePicker).length) inputDatePicker = "#flightonlydepartdatepicker"; if(!$(inputDatePicker).length) inputDatePicker = "#flightandhoteldepartdatepicker"; $(inputDatePicker).datepicker("setDate" , ""); initializeDate($(inputDatePicker).datepicker("getDate").getFullYear()); dateSelected( "", inputDatePicker); validateDays($(inputDatePicker).parents('form').attr('name'), $(this).parent().prev().prev().prev().find('select').attr('name'), null); if (inputDatePicker == "#flightonlydepartdatepicker") { changeReturnDatepicker(); dateSelected( "", inputDatePicker ); constraintReturnFlightDate(); } inputDatePicker = "#flightonlyreturndatepicker"; if($(inputDatePicker).length) { $(inputDatePicker).datepicker("setDate" , ""); initializeDate($(inputDatePicker).datepicker("getDate").getFullYear()); dateSelected( "", inputDatePicker); validateDays($(inputDatePicker).parents('form').attr('name'), $(this).parent().prev().prev().prev().find('select').attr('name')); } // miscellaneous fields $('select[name=nightsselection]').val(''); $('select[name=flexibilityselection]').val(''); $('select[name=flightclassselection]').val(''); $('select[name=ratingselection]').val(''); $('select[name=boardbasisselection]').val(''); // rooms and occupations $('select[name=roomsselection]').val('').trigger("change"); $('select[name=adultsselection1]').val(''); $('select[name=adultsselection2]').val(''); $('select[name=adultsselection3]').val(''); $('select[name=childrenselection1]').val(''); $('select[name=childrenselection2]').val(''); $('select[name=childrenselection3]').val(''); $('select[name=infantsselection1]').val(''); $('select[name=infantsselection2]').val(''); $('select[name=infantsselection3]').val(''); // sorting $('select[name=sortType]').val(''); $('select[name=sortDirection]').val(''); alert("included works");