Haven’t used JQuery, so here’s a blind guess…

 

Do de “additional operations” generate the errors&messages? Remember that
errors only survive until the request that generates them ends. Put another
way, if window.open should generate errors, form.submit is probably
overwriting them…

 

Messages, OTOH, can survive a redirect only if you are using a
RedirectResolution, as they need the FlashScope hash for them to be found.
Again, if window.open should generate messages, form.submit probably will
hide them because there’s no flashscope key associated with the form…

 

Maybe, if you try to explain what “additional operations” you are doing and
whether they are in separate requests, someone can take over it. BTW, doing
a simple onclick=”document.forms[0].submit()” is working OK for me.

 

Hope that helps.

 

  _____  

De: John Emmanuel [mailto:[email protected]] 
Enviado el: miércoles, 07 de enero de 2009 7:07
Para: [email protected]
Asunto: [Stripes-users] Errors & Messages not shown when events aresubmitted
using javascript

 

Hi,

 

The need:

Theres a form with a button/submit. When the link is clicked I need to
intercept

the javascript event, do some additional operations and then finally submit
the form.

 

Eg: 

 

jQuery(document).ready(function(){

    jQuery("#buttonid").click(function(event){

            event.preventDefault();

            var wrapper = jQuery(this);

        var href = wrapper.attr("href");

            var form = jQuery("#formId");

        if(href.indexOf("#")==-1) {

            //Open new window

            window.open(href);

            form.submit();

        }

    })

});

 

The problem:

Errors and messages are not displayed after the resolution. Does not work

even if i don't preventDefault.

 

Everything else works just the way it should except the errors and messages
part.

Am i missing something. Is there a better way to do this?

 

regards,

John

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to