Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Nasty little Safari bug?

Nasty little Safari bug?
Thread Tools
madmacgames
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jul 15, 2005, 02:13 PM
 
In developing a site manger interface, I've ran into a nasty bug with Safari:

File inputs fail to work if they are in a hidden container.

Because some of the forms would look rather complex and long on a single "page", I've decided to split them into common sections and each section is on its own tab. I'm using tab-pane as the base for this, which is a great option because it remebers which tab was last selected on each page, so if for item X you use tab B alot, that will be the default selected tab when you go to edit item X.

Some forms have file inputs, namely for images, that I place on their own tab, adequately called "Images". However, I have discovered that in Safari, if the Images tab is not selected when submitting the form, no files will be uploaded.

PHP is the server code I am running, and printing the $_FILES array shows that indeed if the Images tab is not select in Safari, the $_FILES array is completely empty upon form submission.

I've tested in Firefox, and it behaves as expected, i.e. the entire form is submitted including files.

Safari has no problems submitting the rest of the form. It seems to not submit file fields if they are in a hidden container (when a tab is selected, all other tabs contaner DIVs are hidden).

Has anyone else experienced this? This has got to be the most annoying bug I've ran into... And what can I do? Have a note for Safari users telling them to be sure to select the Images tab before submitting the form? I've already tried having all Image tabs shown when the form is submitted if the browser is Safari, but even that did not work (I guess they were not shown quick enough?)
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
     
TheMosco
Mac Elite
Join Date: Sep 2001
Location: MA, USA
Status: Offline
Reply With Quote
Jul 15, 2005, 07:30 PM
 
http://www.versiontracker.com/dyn/moreinfo/macosx/27294

I know this doesn't help fix your problem, but download this and try it. It downloads the latest Webkit from apple so you can see what the next version of safari will render pages like. It doesn't replace your current version, it just installs a second executable. Just don't run both at the same time. This will atleast allow you to see if this issue is still present in the future safari and maybe you can file a bug if it is.
AXP
ΔΣΦ
     
madmacgames  (op)
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jul 15, 2005, 10:31 PM
 
Originally Posted by TheMosco
http://www.versiontracker.com/dyn/moreinfo/macosx/27294
...

This will atleast allow you to see if this issue is still present in the future safari and maybe you can file a bug if it is.
Thanks I'll try it and see if it is still there, but even if so, it still remains an issue for all Safari 1.3 or earlier users.

And as for filing a bug, I went to the Safari bug report site, or tried to, and you have to be an ADC member to file a bug report... no thanks, I'm not paying $90 just to file a bug report.

I'm putting together a simple example page that clearly demonstrates the issue, if anyone who does have an ADC account would like to file the bug (which I will post here once it is online).
( Last edited by madmacgames; Jul 16, 2005 at 12:06 AM. )
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
     
madmacgames  (op)
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jul 15, 2005, 10:36 PM
 
sorry, I can't use that Nightshift thingy. I am still running Panther 10.3.9
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
     
TheMosco
Mac Elite
Join Date: Sep 2001
Location: MA, USA
Status: Offline
Reply With Quote
Jul 15, 2005, 11:41 PM
 
Originally Posted by madmacgames
Thanks I'll try it and see if it is still there, but even if so, it still remains an issue for all Safari 1.3 or earlier users.

And as for filing a bug, I went to the Safari bug report site, or tried to, and you have to be an ADC member to file a bug report... no thank, I'm paying $90 just to file a damn bug report.

I'm putting together a simple example page that clearly demonstrates the issue, if anyone who does have an ADC account would like to file the bug (which I will post here once it is online).
stinks about 10.3.9. ADC accounts are free btw. You don't have to pay. Sorry i couldn't be more help
AXP
ΔΣΦ
     
madmacgames  (op)
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Aug 8, 2005, 10:20 AM
 
Ok, I've put together a simple and easily reproducible example of the bug.

However, before I submit it to Apple, can anyone on Tiger take a look and let me know if the problem still exists in Safari on Tiger?

http://www.jdecommerce.com/pub/Safar..._input_bug.php
( Last edited by madmacgames; Aug 8, 2005 at 10:27 AM. )
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
     
registered_user
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Aug 8, 2005, 01:42 PM
 
Safari 2.0 (412.2) still shows an empty files array. Well, sorta, the error key has a value of 4. And like you said, it only show up if the files tab is showing on submit.

Other text fields all seem to show up as expected though.
     
madmacgames  (op)
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Aug 8, 2005, 01:53 PM
 
Originally Posted by registered_user
Safari 2.0 (412.2) still shows an empty files array. Well, sorta, the error key has a value of 4. And like you said, it only show up if the files tab is showing on submit.
Well that's ok. You should get an array with blank keys and an error 4 if no files are submitted, but you should still have a non-empty FILES array. You can choose files to upload if you want to as well for the test, the script doesn't do anything with them. The main point of the bug is that if a file input is in a hidden container, Safari does not submit it along with the rest of the form.

Thanks for the Safari 2 report... I'll be filing a bug report with Apple here shortly.
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:36 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,