Re: changing attributes of file control in iframe

  •  07-03-2010, 3:09 AM

    Re: changing attributes of file control in iframe

    Dieter,
     
    We haven't provide API for that yet.
     
    You can try this code:
     
     
     
     
     
    1. function SearchUploaderIFrame()   
    2. {   
    3.     var iframes=document.getElementsByTagName("IFrame");   
    4.     for(var i=0;i<iframes.length;i++)   
    5.     {   
    6.         var f=iframes[i];   
    7.         if(f.ischecked)continue;   
    8.         if(!f.contentWindow)continue;   
    9.         if(!f.contentWindow.document)continue;   
    10.         if(!f.contentWindow.document.body)continue;   
    11.         f.ischecked=true;   
    12.            
    13.         var inputs=f.contentWindow.document.getElementsByTagName("INPUT");   
    14.         for(var j=0;j<inputs.length;j++)   
    15.         {   
    16.             var inp=inputs[j];   
    17.             if(inp.type=="file")   
    18.             {   
    19.                 inp.style.backgroundColor="red";   
    20.             }   
    21.         }   
    22.     }   
    23. }   
    24. setInterval(SearchUploaderIFrame,10);  
     
     
    Regards,
    Terry
View Complete Thread