Support » Plugins and Hacks » [Plugin: SimpleModal Login] Pop login from javascript

[Plugin: SimpleModal Login] Pop login from javascript

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Eric Martin


    Because SimpleModal Login binds the click event to the simplemodal-login class, with jQuery you can trigger the event with:


    Hope that helps.



    Hmm, I celebrated too soon. One issue that arose now is that redirection is taking user after login to wordpress administration backend. That is undesired behavior. When using php function call I can provide the parameter where to go after login:


    but with jquery call I can’t provide the redirect parameter. When I place alert() call in the default.js after the:

    s.url = this.href;

    it pops 3 times with following paths:


    It seems my jquery call parameters are overridden by 2 subsequent additional calls and “http://new.domain.com/login/?redirect_to=%2F” path is lost. When I use just the regular href login link, alert() pops only 1 time showing correct redirect link:


    Any idea what other 2 calls is jQuery('.simplemodal-login').trigger('click.simplemodal-login') triggering and how to prevent it? Or alternatively, is there a way to provide a redirect parameter to jquery to ensure correct redirection after the form is submitted?

    This is what I ended up doing.

    var ref = jQuery("input[name='_wp_original_http_referer']").val();
    jQuery('#loginform').append(jQuery('<input type="hidden" name="redirect_to">').val(unescape(ref)));

    not sure if it is the most elegant way to do it but it works.

    Help me!!!!

    I have tride your script


    This is not working for me why??? Do I need to put som more kode in to
    trigger click onload??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: SimpleModal Login] Pop login from javascript’ is closed to new replies.