Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
select2 fill when saving a new customer

I wish when saving a new client in the modal the fields of the invoice are automatically placed as you can see in the example of name email address

The only field that I need to fill in is the select2 that I am using, it comes out empty

$.ajax({
  url: "/Clientes/nuevo",
  type: "POST",
  data: datos,
  success: function (response) {
    if (response == "success") {
      Swal.fire({
        position: "center",
        icon: "success",
        title: "Se ha registrado al usuario correctamente",
        showConfirmButton: true,
        timer: 1500,
      }).then((result) => {
        if (result.isConfirmed) {
          $("#cliente").select2("destroy");
          $("#cliente").val(datos.cedula);
          $("#nombres").val(datos.nombre);
          $("#correo").val(datos.email);
          $("#direcciones").val(datos.direccion);
        }
      });
    } else {
      Swal.fire({
        icon: "error",
        title: "Error",
        text: "Error al registrar al usuario, comuniquese con el area de sistema",
      });
    }
  },
});

example1

example2

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda