Posts filed under 'Annoyances'

Flash FileReference. Uploading behind a proxy error

When your browser connects to the internet through a proxy and you try to upload using FileRefence you might get an IOError or a 406 http not acceptable error. I say ‘might’ because not all OS browser combinations trigger this error. On Windows/Firefox you will probably get an authentication popup to enter the proxy username and password, but on Mac/Firefox you will get the 406 error.

Anyways if you try searching the net, there are several threads that ask about this proxy error but no answers. I finally found a blog post that had a solution in one of the comments. From Coding Cowboys.

Add to your .htaccess file:

SecFilterEngine Off
SecFilterScanPOST Off

or:

<IfModule mod_php4.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Beware that this will disable the Apache ModSecurity module for that folder.

I just saw that the Adobe livedocs upload reference also has a comment by: log2e, regarding the 403 and 406 errors.

2 comments May 1st, 2008

Disable options in a multiple select – Javascript for IE

Yeah, you might be amazed if you thought that just setting the option to disabled would work, even in IE7.
But it looks like it only works on proper browsers.

I searched the net everywhere to see how other people were doing it and I found this method (from: www.lattimore.id.au) to be the best one for my needs. I made some updates to it: I was using a multiple select list and also because I was creating the select box from an AJAX response. So here’s the code:

  1.  
  2. function emulateDisabled(selectBox) {
  3.  for (var i=0, option; option = selectBox.options[i]; i++) {
  4.         if (option.disabled) {
  5.                 option.style.color = "graytext";
  6.         }else{
  7.                 option.style.color = "menutext";
  8.         }
  9.  }
  10. }
  11.  
  12. function restoreEmulateDisabled(selectBox) {
  13.  for (var i=0, option; option = selectBox.options[i]; i++) {
  14.         if(option.selected &amp;&amp; option.disabled){
  15.                 option.selected=false;
  16.         }
  17.  }
  18. }
  19.  
  20. function addEmulation(selectBox){
  21.  window.select_current = new Array();
  22.  selectBox.onfocus = function(){ window.select_current[this.id] = this.selectedIndex; }
  23.  selectBox.onchange = function(){ restoreEmulateDisabled(this); }
  24. }
  25.  

If you are generating your select element with AJAX, just call emulateDisabled(your_select_box);
on the onComplete function.
If you would like to have all your select elements to have this functionality then add this onload function:

  1.  
  2. window.onload = function() {
  3.  if (document.getElementsByTagName) {
  4.         var s = document.getElementsByTagName("select");
  5.         if (s.length > 0) {
  6.                 window.select_current = new Array();
  7.                 for (var i=0, select; select = s[i]; i++) {
  8.                         select.onfocus = function(){ window.select_current[this.id] = this.selectedIndex; }
  9.                         select.onchange = function(){ restoreEmulateDisabled(this); }
  10.                         emulateDisabled(select);
  11.                 }
  12.         }
  13.  }
  14. }
  15.  

A big thanks to the guy from lattimore.
cheers mate.

8 comments August 16th, 2007

DIV height issue on IE

If you need to have a div tag smaller than 20px, then you will find it a bit hard to get on IE. Just add “overflow: hidden” to it’s style and you’re good to go.

I know it’s a quick google find, but there are several methods that you’ll find.
Some are telling you to add a   and set the font-size to 1px, but they all sound “hackish” to me.

I’ve been having several cross-browser related issues lately and all of them have to do with IE (well most of them on Safari, but I’m comparing IE/Firefox) I remember back in the old days when you had to work really hard to get it working on Netscape 4.016.

Is IE becoming the next Netscape?

16 comments July 31st, 2007

Textformat for input boxes

I was having the following issue and I spent a lot of time figuring it out.

I had an Input Text and applied some formatting to it, using target.setTextFormat(format). But the format would only work if the textfield had some text in it.

I tried to “hack” around it and leave some text in it, then apply the textformat then remove the text. But when doing: target.text = “”; The formatting was also removed.

I’ve noticed that for “new text” that the user might input, you need to use: target.setNewTextFormat(format)

That worked like a charm, and all my input texts look like they’re supposed to.
I hope someone finds this useful.

Add comment July 31st, 2007


Calendar

March 2010
M T W T F S S
« May    
1234567
891011121314
15161718192021
22232425262728
293031  

Posts by Month

Posts by Category