You guys are awesome!

It's working fine, and my customer will be ecstatic.  If anyone wants
to tell me that there's a simpler way, I'm all for it, but it's
functional now (I think).  And I think that I used tidbits of what each
of you recommended!  Oh, and I totally agree on FireBug being
essential.  I wouldn't have made it this far, without that!

Thanks guys!
Dianne (hoping that the morning light doesn't shed some shadow on my
thinking)

1. Added a hidden field in my form, called redirectURL.
2. Added class="async" to any "hrefs" that I want to trigger a submit
from
3. Changed my controller to redirect to the value of "redirectURL".
4. Added the following to my Javascript (same code found on
http://trac.mochikit.com/wiki/HowtoSimpleAjax

var clicklink = function (url) {
    return function (evt) {
        // prevent the normal 'click' action for a link
        evt.stopPropagation();
        evt.preventDefault();



        MochiKit.Logging.log("url is " + url);
        var mainform = currentDocument().forms['formid'];
        mainform.elements['redirectURL'].value = url;
        MochiKit.DOM.getElement('submit').click();
    }
};
var convertA = function (linkelement) {

MochiKit.DOM.addToCallStack(linkelement,'onclick',clicklink(linkelement.href));
};
        var initpage = function () {

        
MochiKit.Base.map(convertA,MochiKit.DOM.getElementsByTagAndClassName('a','async'));
};
 
MochiKit.DOM.addLoadEvent(initpage);


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to