Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

click event problem

$
0
0

I a editor form i have a link (or button), if the link are clicked the editor form should be closed and another editor form should be open. But the browser did not recognizes the click on the Link or Button.

I insert the link with the template in the form like this:

    <div id="tplLogin">
        <div class="row mb-0">
            <div data-editor-template="usrname" class="col-lg-12"></div>
        </div>
        <div class="row mb-0">
            <div data-editor-template="usrpwd" class="col-lg-12"></div>
        </div>
        <div class="row mb-0 pl-30">
            <div id="recap2" class="col-mg-12"></div>
        </div>
        <div class="row mb-0 pl-30">
            <div class="col-mg-12"><button id="usr-forgotpw">' . $authInfo['forgot'] . '</button></div>
        </div>
    </div>

i write this click event, but this would not work

    $( '#usr-forgotpw' ).on( 'click', function() { console.log( ' click' );
        forgot
        .title( '<i class="fad fa-key txt-DarkCyan"></i> <span class="txt-DarkCyan bold">' + frmInfo.f_title + '</span>' )
        .buttons( [
            { label: frmInfo.send, action: function() { 
                this.submit( 
                    function() {
                        //window.location.href = 'index.php';
                    },
                    function( data ) {
                        this.close();
                        _PNotify( 'error', data['error']['errCode'] + ' ' + data['error']['errShort'], data['error']['icon'], data['error']['info'] );
                    }, function( data ) {
                        var cap = $( '#g-recaptcha-response' ).val();
                        if( 'undefined' === typeof cap ) { 
                            this.close();
                        } else {
                            data.response = cap;
                        }
                    }
                );
            }, className: 'btn-DarkCyan' },
            { label: frmInfo.cancel, action: function() { this.close(); } }
        ] )
        .edit();
        $( 'div.modal-dialog' ).removeClass( 'registration-dialog login-dialog' ).addClass( 'forgot-dialog' );
        $( 'div.modal-content' ).removeClass( 'registration-content login-content' ).addClass( 'forgot-content' );
        $( '<div class="g-recaptcha" data-sitekey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">' +
            '</div><script src="https://www.google.com/recaptcha/api.js"></script>' ).insertAfter( '#recap3' );
    } );

Have anyone a idea, why the click event not work? I tryed to add an third button, but i have the same problem. The editor closed with the close() function but i can not open the new editor form

Andreas


Viewing all articles
Browse latest Browse all 3740