[Dojo-interest] FormBind doesn't work - submit and click are nevercalled

Andrew Scott andrew.scott at aegeon.com.au
Tue Jan 2 23:01:32 MST 2007


There are a few things I can spot wrong straight away.

Although you may have removed it for security reasons, but you need a url to
call.

url: '/someurl/page.cfm',

And when you bind it its not _container_.addOnLoad(magicForm); it should be
dojo.addOnLoad(magicForm)

But the examples I have seen always do this

<body onLoad="magigForm()">
</body>

HTH


Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273


-----Original Message-----
From: dojo-interest-bounces at dojotoolkit.org
[mailto:dojo-interest-bounces at dojotoolkit.org] On Behalf Of Mario Minati
Sent: Wednesday, 3 January 2007 6:41 AM
To: dojo-interest at dojotoolkit.org
Subject: [Dojo-interest] FormBind doesn't work - submit and click are
nevercalled

Hello @all,

I try to submit a form, which is seated in a ContentPane, that is 
externally loaded (scriptscope activated).
I am testing and developing on Firefox 2.0 under Kubuntu Linux.

The following code is executed in the form ContentPane.

  <script type="text/javascript">
    function magicForm() {
        var x = new dojo.io.FormBind({
            formNode: dojo.byId('company_form'),
               
            load: function(load, data, e) {
                dojo.debug("load called");
                dojo.byId('test').innerHTML = data;
            }
        });
    x.onSubmit = function(form) {
        dojo.byId("test").innerHTML = "Loading...";
        dojo.debug("onsubmit called");
        return true; // need this, otherwise form won't get sent!
    }
        dojo.debug("formBind created");
    }
           
    _container_.addOnLoad(magicForm);
  </script>



More information about the Dojo-interest mailing list