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

173
Vistas
assign id to jquery dialog button

How do i assign an an id to a jquery dialog button. I tried the following but it's not working

buttons: {
Ok: function() {
id="xyz",
...
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

The following (seemingly undocumented) works for me with jQuery 1.8.9:

$("#dlg").dialog({
  buttons :  { 
     "MyButton" : {
         text: "My Button",
         id: "my-button-id",
         click: function(){
             alert("here");
         }   
      } 
   }
});

The button can be addressed via $("#my-button-id")

over 4 years ago · Santiago Trujillo Denunciar

0

This code from official site worked for me:

$('#dialog').dialog({
    // properties ... 
    buttons: [{
        id:"btn-accept",
        text: "Accept",
        click: function() {
            $(this).dialog("close");
        }
    }, 
    {
        id:"btn-cancel",
        text: "Cancel",
        click: function() {
            $(this).dialog("close");
        }
    }]
});
over 4 years ago · Santiago Trujillo Denunciar

0

@BerndB: Thanks it works perfectly and even is more extendable.

$('#loginlink').live('click',function(){
    DC = 'login_box';
    diaOpt = {
        autoOpen : true,
        width : 400,
        title : 'Login',
        buttons: {
            //valiudate login
            'Login' : {
                text : 'Login Now',
                id : 'validateForm',
                click : function(){
                }   
            }
        }
    }

    launchDialog(diaOpt, DC);
});

$('#validateForm').live('click', function(){
    alert('Hellop');
    $("#loginform").validate();
});
over 4 years ago · Santiago Trujillo Denunciar
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