Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z onchange w input file w ie
marrrecki
post 17.01.2008, 11:19:31
Post #1





Grupa: Zarejestrowani
Postów: 110
Pomógł: 0
Dołączył: 19.07.2006
Skąd: Lublin

Ostrzeżenie: (0%)
-----


Witam. MAm problem. zrobiłem sobie funkcję, która po wybraniu jednego pliku poprzez input file tworzy mi w divie kolejny input. wszystko działa pod operą i ff, ale pod ie niestety nie chce.
Oto ta funkcja:
  1. function DodajElement()
  2. {
  3. var element = document.createElement('input');
  4. element.setAttribute('type', 'file');
  5. element.setAttribute('onchange', 'javascript:DodajElement();');
  6.  
  7. var liczba = 0;
  8. var ilosc = document.forms['newsy_edit'].elements.length;
  9. for (var i = 0; i < ilosc; i++ )
  10. {
  11. if (document.forms['newsy_edit'].elements[i].type == 'file')
  12. {
  13. liczba += 1;
  14. }
  15. }
  16.  
  17. element.setAttribute('name', 'file-'+(liczba+1));
  18.  
  19. element.style.display = "block";
  20. element.style.margin= "2px";
  21.  
  22. var div = document.getElementById('dodatkowe');
  23. div.appendChild(element);
  24.  
  25. //alert(element.onchange);
  26.  
  27. document.forms["newsy_edit"].dodatkowe_ilosc.value = liczba;
  28. }


Czy ktoś może mi powiedzieć o co biega?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 04:36