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

271
Views
Sweetalert2 Campo de fecha obligatorio

Hola, tengo una ventana emergente sweetalert2 que, cuando se hace clic, llama a un método api. Lo que estoy tratando de lograr es tener un campo de entrada de selector de fecha que sea obligatorio si hacen clic en el botón Sí. También necesito pasar la fecha que eligen a mi método api. Aquí está mi código

 const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', cancelButton: 'btn btn-danger' }, buttonsStyling: false }) swalWithBootstrapButtons.fire({ title: 'Do you want to activate user <font color="red">' + user[1] + ' ' + user[2] + '</font>', text: "Email: " + user[3], icon: 'question', showCancelButton: true, confirmButtonText: 'Yes', cancelButtonText: 'No', reverseButtons: true }).then((result) => { if (result.isConfirmed) { $.ajax({ url: "../api/myController/controllerMethod", type: "get", //send it through get method data: { Id: user[0], ModifiedBy: user[1]' }, success: function (response) { swalWithBootstrapButtons.fire( 'Activated!', 'The user is activated.', 'success' ) var table = $('#dtMembers').DataTable(); table.ajax.reload(); }, error: function (xhr) { //Do Something to handle error } }); } else if ( /* Read more about handling dismissals below */ result.dismiss === Swal.DismissReason.cancel ) { //swalWithBootstrapButtons.fire( // 'Cancelled', // 'Your imaginary file is safe :)', // 'error' //) } })

Así es como se ve actualmente ingrese la descripción de la imagen aquí

Estoy tratando de hacer que se vea algo como esto ingrese la descripción de la imagen aquí

Gracias

about 4 years ago · Juan Pablo Isaza
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!