Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Form JS Live Validation not working if there is SWFUPLOAD field


Go to End
Reply


14 Posts   2975 Views

Avatar
draft

Community Member, 57 Posts

11 November 2009 at 3:41pm

Hi,

I have swf upload working on my form, the thing is the live validation is not working anymore, for example is, if the first field i set as required, if there is swfupload, after i browse the file i want to upload then click submit, then it will upload the file first then redirect back and said that the first field is required (the file is already uploaded).

Can someone point me a way so the live validation still working first? So the file isn't uploaded yet until everything is ok?

Thx.

Avatar
UncleCheese

4085 Posts

11 November 2009 at 4:27pm

That's odd. I've never had that happen. If you look at the handlers.js, the onsubmit function is tested before the form gets submitted by SWFUpload.

      if( typeof(form.onsubmit == 'undefined') || (typeof(form.onsubmit == 'function' ) && form.onsubmit())) {


I'm actually working on a SWFUpload project now.. I'll do some testing.

Avatar
draft

Community Member, 57 Posts

11 November 2009 at 6:44pm

Hi UC,

Hmm so in my condition, if i haven't browse the file, the submit button is hidden, when i browse it, the submit button is there, but the thing is, the js validation is not working anymore. It will refresh the page(upload the file).

Is it not happened with you? Or is it possible i got the old code...

Thx before UC.

Avatar
UncleCheese

4085 Posts

19 November 2009 at 4:58am

I just checked in a patch that should fix this error.

Avatar
Carbon Crayon

Community Member, 598 Posts

6 September 2010 at 11:35pm

Edited: 06/09/2010 11:36pm

Hi UC,

This seems to be an issue again, but now with Uploadify. If I add a FileUploadField into my front end form, jQuery Validate() no longer works.

Inspector gives this error when fileUploadField is present:

Uncaught TypeError: Object #<an Object> has no method 'validate'

I guess something is conflicting but can't see what.

I am using Validate v1.7 and jQuery 1.4.2, both added in Page_Controller init() function.

Many thanks

Aram

Avatar
UncleCheese

4085 Posts

7 September 2010 at 3:58am

Should be fixed now.

Avatar
apiening

Community Member, 60 Posts

7 September 2010 at 9:29am

Speaking of which...

Hi all, hi uncle cheese,

using swfupload on a 2.4 project and running the unit tests gave me a fatal error due to SWFUploadFileIFrameField_Uploader extending Image_Uploader which doesn't exist anymore.

The other thing I noticed is that there are no unit tests for dataobject_manager, event_calendar and swfupload. Since our QA procedures require a certain test coverage I'd love to see some tests. Are there any plans to add unit tests?

This is not supposed to sound harsh. I'm writing this because I like what you do and I'd like to use your modules more often.

Thanks

Avatar
UncleCheese

4085 Posts

7 September 2010 at 11:48am

For the SWFUpload question, I'm not supporting that module anymore, in favor of the new Uploadify module. You'll find that a lot easier to implement than SWFUpload fields.

http://www.leftandmain.com/silverstripe-modules/2010/08/26/uploadify/

Unit tests.. I'd love to implement unit tests, but there are a few things standing in my way.

1) I've never quite understood the concept. Every time someone explains it to me, I understand it less.

2) The code in those modules is so bad and redundant and non-conforming that I really don't think unit tests are appropriate at this point. I'd love to implement them in modules like Uploadify and Postale, which are built much more sustainably. DOM is just a hodgepodge of patchwork fixes and kneejerk coding.

---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

Go to Top