Hi there,

Is there any existing facilities to trigger some custom Javascript
code _after_ validating the form?

I'm now doing it with some Javascript tricks:
===============
<form t:type="form" t:id="myform">
...
<script type="text/javascript">
Event.observe(window, "load", function() {
    var f = $("myform").onsubmit;
    $("myform").onsubmit = function(e) {
        return f(e) && customFunction();
    };
});
</script>
</form>
...
<script type="text/javascript">
function customFunction() {
  //return true to submit
}
</script>
===============

Notice that the custom function is only called _after_ validation
_and_ only if it was successful.

Since this is all boiler-plate I'm going to make it a component that
can be nested within <t:form/>, but before that I want to make sure
I'm not reinventing something that already exist. Or just tell me if
I'm going the wrong way and the _proper_ way to do it.

Your input is much appreciated.

Kenneth

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to