Skip to content

Instantly share code, notes, and snippets.

@geronimod
Created January 31, 2013 11:24
Show Gist options
  • Save geronimod/4682219 to your computer and use it in GitHub Desktop.
Save geronimod/4682219 to your computer and use it in GitHub Desktop.
chunk of mecado publico js search
//-----------------------------------
// BUSQUEDA de LICITACIONES
//-----------------------------------
function executeAcquisitionsSearch() {
var actionUrl = $('#urlBusqueda').val();
var datosForm = $("#frm-search").serialize();
$("#frm-search").validate();
var isValid = jQuery('#frm-search').valid();
if(!isValid)
return false;
if ($("#FechaDesde").datepicker("getDate") != null) {
if ($("#FechaHasta").datepicker("getDate") < $("#FechaDesde").datepicker("getDate")) {
$("#div_validaFechas").show();
setTimeout(function () {
$('#div_validaFechas').hide();
}, 4500);
return false;
}
else {
$("#div_validaFechas").hide();
}
} else {
$("#div_validaFechas").hide();
}
//setValuesToSearch();
mostrarVistaResultados(false);
$.ajax({
async: true, //Soluciona problema con Chrome
url: actionUrl,
type: "POST",
dataType: "json",
data: datosForm,
//contentType: "application/json; charset=utf-8",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
success: function (jsondata) {
$('#navegadores').html(jsondata.navegadoresHtml);
$('#resultados').html(jsondata.licitacionesHtml);
if (jsondata.statusCode == 0) {
return mostrarMsgError(jsondata.statusMessage);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment