2

When the file is uploaded with standardsubmit set to false (the default) the file uploads, but then a javascript error crashes it because it cannot parse the reply - it's expecting a JSON response.

When set to true, it works, but you cannot alter the target (or if you can, I can't find out how), which is something I need to do, I need it to upload to an invisible iframe to prevent the page posting back.

Is there some way to get it to ignore the response or accept a normal http response? I am not convinced submitting a form even gives you a response. I just want to run code once the file is uploaded.

Anyone have any ideas? The error is basically within the library itself, trying to parse a json response but the response is an empty string so it errors.

1
  • Do you have access to the script on the server that handles the file upload? Why not make it return JSON? Commented Jul 21, 2010 at 18:07

2 Answers 2

1

There is no error. The FormPanel expects to receive { success: true } if everything went well, or { success: false, errors: [...] } if something went wrong.

Based on this reply, the handler actually calls other event handlers responsible for highlighting the fields that failed server-side validation, etc.

You need to change your server side script to return what ExtJS expects it to return.

Sign up to request clarification or add additional context in comments.

Comments

1

There is a serious lack of documentation (or at least, searchable documentation) for extjs! Eventually I found the solution, which allowed me to change the target. It was control.dom.target I believe. This was the ideal solution too because I didn't want to implement a 'hack' of server-side code for a specific client-side solution.

Incidentally, returning { success: true } also worked, I tried it afterwards.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.