Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!