Ticket #222 (reopened defect)

Opened 5 months ago

Last modified 1 month ago

upload control problem in IE7

Reported by: sdm Assigned to: mpo
Priority: major Milestone: 0.4
Component: < Upload Control Version: trunk
Keywords: Cc:

Description

A page with an upload control loads in IE7 with Javascript error: "invalid argument"

When the uploadcode in formConfig is commented out, the page loads without a problem:

'uploadData' : {

base: 'file', '+validators': {fileTypeValid: {}}, control: 'myupload'

}

Attachments

Screenshot-issue222-onie.png (64.2 kB) - added by mpo on 22/01/10 12:23:02.
error dialog upon loading of the page

Change History

08/10/09 08:16:30 changed by sdm

I discovered why the page loads with Javascript errors. Apparently you can't have "div" elements in the form if you also have an upload control defined in the same form. The "div" elements should be "span" elements (I haven't tried with other types of tags) For example, this makes the page load with errors:

<form id="my-form" method="PUT">

<div kauri-idref="id" class="input" kauri-type="integer">

<label kauri-role="label" class="input">Id</label> <input kauri-idref="id" class="input" size="5" disabled="true"/> <span kauri-role="messages" class="messages"/>

</div> <div kauri-idref="uploadData" kauri-type="file" kauri-control="myupload">

<label kauri-role="label" class="input">Image</label> <span kauri-role="messages" class="messages"/>

</div>

<input class="submit" type="submit" value="verzenden" />

</form>

But this loads the page without a problem:

<form id="my-form" method="PUT">

<span kauri-idref="id" class="input" kauri-type="integer">

<label kauri-role="label" class="input">Id</label> <input kauri-idref="id" class="input" size="5" disabled="true"/> <span kauri-role="messages" class="messages"/>

</span> <span kauri-idref="uploadData" kauri-type="file" kauri-control="myupload" >

<label kauri-role="label" class="input">Image</label> <span kauri-role="messages" class="messages"/>

</span>

<input class="submit" type="submit" value="verzenden"/>

</form>

But when you then try to upload something, the file is uploaded as (application/octet-stream 0kB), so even though the page seems to load correctly, you still can't upload a file.

11/12/09 22:25:57 changed by mpo

  • status changed from new to closed.
  • resolution set to fixed.

After the recent refactoring (see r1399 and following) these both seem to work. Just as a general side-note though: method=PUT on these forms doesn't really make sense, does it?

Adding a sample in r1406 to show this working.

19/01/10 09:40:09 changed by sdm

  • status changed from closed to reopened.
  • resolution deleted.

Apparently, the problem only occurs if the form tag is enclosed in a p-tag. I edited the sample page and the error also occurs there.

<p> <form> <div></div> ... upload control goes here </form> </p>

When no div is used inside the form tag, but the form tag itself is enclosed in a p-tag, all works well. But the combination of a p-tag with a form that has an upload control and a div seems to cause problems.

22/01/10 12:22:19 changed by mpo

Added a test/sample in r1433 to show the issue. Error description:

When the page loads IE pops up an error-dialog stating "Error: Invalid Argument" On line 275, Char 4. Unclear which file though.

Adding screenshot next that shows it.

22/01/10 12:23:02 changed by mpo

  • attachment Screenshot-issue222-onie.png added.

error dialog upon loading of the page

31/01/10 17:40:53 changed by jgou

  • priority changed from minor to major.
  • component changed from modules/kauri-forms to < Upload Control.