• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Safari WOFileUpload in a hidden div Bug & Workaround
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Safari WOFileUpload in a hidden div Bug & Workaround


  • Subject: Safari WOFileUpload in a hidden div Bug & Workaround
  • From: Paul Stringer <email@hidden>
  • Date: Wed, 17 Oct 2007 12:54:05 +0200

I've managed to fix a bug I was having revolving around Safari WOFileUpload & Hidden Divs and thought I'd share. Unfortunately it's a hack involving Javascript but it works.

The problem itself manifests itself when you have a WOForm with a WOFileUpload which when it is submitted has the WOFileUpload in a part of the page that is hidden. On the first Submit everything will be fine, if you submit again you get a dreaded "No form data left for WOFileUpload"

It seems related to this
http://lists.apple.com/archives/Webobjects-dev/2005/Sep/msg00471.html

and this
http://lists.apple.com/archives/Webobjects-dev/2005/Mar/msg00362.html
(the solution of binding enctype to a local string type did nothing for me)


So heres the Javascript, it's done in Jquery to keep it simple

<!-- A Crazy fix for the Safari WOFileUpload in a hidden div Bug -->
<script>$(document).ready(function(){
if ($.browser.safari) {
//Show any hidden divs that contain a WOFileUpload when a form is submitted
$("input[@type=submit]").click( function(){
$("div.wofileupload:hidden").each(function(){
//Push it off the screen so people can't see it.
$(this).css("position","absolute");
$(this).css("left","-1000em");
//Make it visible to fix the WOFileUpload missing form data exception
$(this).show();
});
});
}
});
</script>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Prev by Date: Re: Leopard & Xcode 3
  • Next by Date: (no subject)
  • Previous by thread: Re: Leopard & Xcode 3
  • Next by thread: Weird problem ...
  • Index(es):
    • Date
    • Thread