Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda