Skip to content

Instantly share code, notes, and snippets.

@jlcampana
Created November 27, 2013 09:15
Show Gist options
  • Save jlcampana/7672863 to your computer and use it in GitHub Desktop.
Save jlcampana/7672863 to your computer and use it in GitHub Desktop.
Popurrí jQuery y Formularios
$('#boton_submit_etiquetas').click(function()
{
$('#formulario').attr('action', '{{etiquetas_url|e}}');
$('#formulario').attr('method', 'POST');
$('#formulario').submit();
});
$('#boton_submit').click(function()
{
$('#formulario').attr('action', '{{url_base|e}}');
$('#formulario').attr('method', 'POST');
if(chequeaTicketCaja())
{
$('#formulario').submit();
}
else
{
showAlertWithMessageAndTitle('Los campos "Ticket" y "Caja" son obligatorios.','Picking');
}
});
$('#formulario').submit(function(e)
{
$('#boton_submit').attr("disabled", true);
var ok = chequeaTRRG();
if(!ok && tipoSubmit == 1)
{
mensaje = "<strong>Faltan algunos TR y RG</strong><br><br>Debe especificar el TR y el RG de los tickets seleccionados";
showAlertWithMessage(mensaje);
$('#boton_submit').attr("disabled", false);
e.preventDefault();
}
});
$('#boton_buscar_reservas').click( function()
{
$('#form_search_reservation').validate(
{
rules:
{
search_text:{required : true , minlength : 1 }
}
,
messages:
{
search_text: { required: "", minlength : "" }
}
,submitHandler: function(form)
{
$('#ventana_modal_busqueda').modal('hide');
form.submit();
//$('#boton_buscar_reservas').attr("disabled", true);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment