user3459955
user3459955

Reputation: 3

Called javaScript function from jquery dialog button

I'm trying to call javascript function from jquery dialog buton, but it is not working

my code :

============================
$('#dialogAddActe').dialog({
        autoOpen: false,
        modal: true,
        width: 800,
        height:400,
        show: "slide",
        hide: "slide",
        buttons: {
            "Suivant": function() { 
                $(this).dialog("close"); 

                if ($(this).checkNombre())
                {

                document.forms[0].dispatch.value = "ajouterActe";
                document.forms[0].submit();

                }

            }, 
            "Annuler": function() { 
                $(this).dialog("close"); 
                document.forms[0].patientId.value="";
            } 
        }
    });

============================

$(this).checkNombre() is not working.

BR, Med Baba

Upvotes: 0

Views: 120

Answers (1)

Racil Hilan
Racil Hilan

Reputation: 25351

Remove $(this), just use if (checkNombre()).

Upvotes: 1

Related Questions