Submitted by david on Fri, 01/20/2006 - 05:58.
While many of you are using Dojo to create
high-powered,
dynamic applications, I often find myself "sprinkling" Dojo here and there to improve the user experience on "normal" web pages. It is with that in mind that I present to you
dojo.io.FormBind.
FormBind allows you to quickly setup your "Web 1.0" form for asynchronous submission. How do you do it? Easy:
function magicForm() {
var x = dojo.io.FormBind({
// reference your form
formNode: document.forms[1],
load: function(load, data, e) {
// what to do when the form finishes
// for example, populate a DIV:
dojo.byId('myDiv').innerHTML = data;
}
});
}
dojo.addOnLoad(magicForm);
You can
play with the demo to see it in action. The code is hot off the press, so you'll have to get the
latest nightly build to play with it.
Update: I've added an
onSubmit function which allows you to validate the form before sending and/or show some sort of loading/progress indicator. The demo has been updated with simple "Loading..." text (which you may miss if your connection is fast enough).
Nice hack!
If it is part of core is it
Thanks, David. ...this is
Hi Mark, If I've understood
Yes. You would tweak
'myDiv'to point at the div you want to output the server HTML to.Chris, one correction: we
dojo.transport, notdojo_transport. So, on the server, you can check to see ifdojo.transportcomes through asxmlhttp. If so, you just return the fragment of HTML you need as opposed to the entire page! I should add that test case to my example.It would be nice to have a
[...] Like all things in Web
Ah well, thats using php for
[...] With regard to
As long as we're simplifying
Sorry I have a problem, I am
Is it possible to submit a
i have tried to get this
cool example would need it
yep
I am not able to use
michael: other posts have
I've found FormBind to be
cool! i'm still looking for
with <input
with
oops. seems tags are simply
Hi guys, I've been more or
whoops. I guess I can't
Hi David, at post 6 you
I don't get the simplest
Anyone?
As mentioned by Patrick on
In advance... here I have a
I am new to dojo. Can
When I submit the form it's
So, why does the response
To post #25
Using FormBind for file
I think dojo should have a
The do-it-yourself approach
I have the fallowing
Only change the error
Thank you
If I formBind my formobject,
Hmmm.. I've made a form
How to call a javascript
What about Web 2.0 forms
What about Web 2.0 forms processing with dojo?
The original post discussed 'sprinkling' dojo in with existing Web 1.0 code. What if you are writing form-processing logic using dojo from scratch? Where is a good example of submitting values from a form to a java or jsp server, and updating portions of the markup, instead of refreshing the whole form?
What about Web 2.0
What about Web 2.0 forms
What about Web 2.0 forms processing with dojo?
The original post discussed 'sprinkling' dojo in with existing Web 1.0 code. What if you are writing form-processing logic using dojo from scratch? Where is a good example of submitting values from a form to a java or jsp server, and updating portions of the markup, instead of refreshing the whole form?
The example is not available. I tried the link but no luck
Hi All!
Please excuse my post but I am trying to get a simple example of using the Dojo tools with simple form validation. (no ajax yet) I am wanting to use the Dojo tools to simplify the javascript validation of the form fields but I still want to process the page as before. It was my hope that the example above would do that. The link to the demo and the download are both non-functional.
"You can play with the demo to see it in action." /// not working
and "...get the latest nightly build to play with it." /// not working
Does anyone have an example of a simple page using dojo validation without ajax an calbacks. I want to use Dojo but I cannot rebuild the supporting pages before I have a better handle on it. Any help or links would be much appreciated.
Thank you for your help.
Don Myers