[development] hijack node submit/preview to process ajax call first?

Aaron Winborn winborn at advomatic.com
Tue Nov 16 18:48:43 UTC 2010

I'm creating an HTML5 canvas editor for a filefield widget, which 
uploads a canvas image, returning an FID to be stored in a textfield. 
Everything works, except that now I want to delay node submission until 
the canvas has a chance to save its work (assuming its associated 'Save' 
button hasn't yet been clicked).

I'm mostly there, thanks to some help from merlinofchaos. Currently, I 
save the work and return false on the submit/preview click, and 
trigger('submit') after the ajax call to save the canvas. However, it's 
not quite working -- the canvas saves properly, storing the new fid in 
the field, but the form is reloaded, rather than processing.


Any ideas?


Aaron Winborn

Advomatic, LLC

Drupal Multimedia available now!

My blog:

More information about the development mailing list