On Fri, Dec 09, 2005 at 01:06:52PM +0000, Arnar Birgisson wrote:
> 
> Hi Evan,
> 
> Sure, just use an <input type="button" onclick="whaeverjavascript();"
> /> instead of <input type="submit" ... />.
> 
> Also, don't use <form>..</form> tags around your form, that way, when
> the user presses enter while inside any of the controls, nothing get's
> submitted.

Couldn't you, just as easily, override the form's onSubmit?  That way enter
still works to submit the form as well.

> Also, have a look at the functions "formContent" (in the DOM module)
> and "queryString" (in the Base module) in Mochikit. That way, if you
> have your form elements inside a div with id="formdiv", you can do
> this:
> 
> var formvalues = formContent($('formdiv'));
> var qs = queryString(formvalues[0], formvalues[1]);
> var deferred = loadJSONDoc('yourjsonreturningview?' + qs);
> deferred.addCallback(function (result) { /* do whatever with the result */ }
> 
> Arnar
> 
> 2005/12/9, evan <[EMAIL PROTECTED]>:
> >
> > I'd like to have a form end up invoking a method that passes back its
> > results in JSON but I don't know how to do this.  Is there a way to
> > accomplish this?
> > Thanks in advance,
> > Evan
> >
> >
> 

-- 
If you understand, things are just as they are.  If you do not understand,
things are just as they are.

Attachment: pgpNLgvKXG1P8.pgp
Description: PGP signature

Reply via email to