changing attributes of file control in iframe

Last post 07-03-2010, 3:09 AM by cutechat. 2 replies.
Sort Posts: Previous Next
  •  06-10-2010, 7:59 AM 61662

    changing attributes of file control in iframe

    Greetings!
     
    I would like to dynamically change an attribute of the file input control when in iframe mode.
    Specifically, I'd like to change the lang attribute, depending on the language our website is being browsed in.
    For example: <input type="file" lang="en" />
     
    Any idea how to accomplish this?
     
    Thanks
    Dieter
     
  •  06-16-2010, 11:37 AM 61818 in reply to 61662

    Re: changing attributes of file control in iframe

  •  07-03-2010, 3:09 AM 62269 in reply to 61662

    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 as RSS news feed in XML