$(function() { $('[name=terms]').on('input',function() { // var results = $(this).next('.results'); var results = $(this).parent().find('.results'); if($(this).val().length>=2){ $.ajax({ url: '/eng/ajax/search_restaurantes', type: 'get', data: {q: $(this).val()}, success: function(response) { results.html(response); results.removeClass("hidden"); results.parent().addClass("open"); } }); }else{ results.html(""); results.addClass("hidden"); } }); $('#home-featured [data-toggle=tab]').click(function (){ id=$(this).attr('href'); $(id).html('
'); $(id).load('/eng/ajax/home_featured_tabs',{list:$(this).data('list')}); }); $('#home-featured .active [data-toggle=tab]').click(); $('#home-quick-lists [data-toggle=tab]').click(function (){ id=$(this).attr('href'); $(id).html('
'); $(id).load('/eng/ajax/home_top_tabs',{list:$(this).data('list')}); }); $('#home-quick-lists .active [data-toggle=tab]').click(); $('form[data-submit="auto"]') .addClass('auto-submit') .on('change', 'input, textarea, select', function() { $(this).parents('form').submit(); }); $('.reserva_date').datetimepicker({ format: 'DD-MM-YYYY', language:'es', startDate: "2017-12-15", pickTime:false }); });