undefined is not a function when PopUpForm Includes <input type="file" />

Dec 13, 2011 at 3:58 AM

Hi, first of all thanks for these wonderful helpers.

I'm having trouble including a <input type="file" /> tag inside a PopUpForm, as long as I don't include it all works fine, but when I include it the PopUpForm does not close, it throws a "undefined is not a function" error before the save action is called, and a "Object function (a,b){return new e.fn.init(a,b,h)} has no method 'handleError'" after, it is weird though because work is done correctly on the DB, but the PopUpForm does not close and the successFunction is never called.

Do you have any idea of what is causing this behavior? Or any work around?

In some forms I need to allow the user to upload an image, I got it working using colorbox (which uses an iframe), but since I already use Project Awesome for other things I'd prefer not to include extra plugins, besides I love how Project Awesome's PopUpForm work and look, please help.

Thanks in advanced

Amilkar Reyna 

Coordinator
Dec 13, 2011 at 9:11 AM

try adding enctype = "multipart/form-data"  to your form tag, see if that helps

Dec 13, 2011 at 1:09 PM
Edited Dec 13, 2011 at 1:11 PM

Thanks for your quick reply, adding enctype = "multipart/form-data" was the first scenario I tried, sadly it behaves exactly the same, same set of errors get thrown by Chrome's JScript debugger.

Other thing I've noticed is that the problem is exclusive to the  type="file" any other type works fine.

Coordinator
Dec 13, 2011 at 8:00 PM

the form in the popup is submitted via ajax 

http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery

Dec 14, 2011 at 2:50 PM

aaa, so that is why it works fine when I use an iframe, thanks, that really cleared things up.