Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JS]Co zrobić ay po dodaniu pliku zmienił się inny div na widoczny
pacior
post
Post #1





Grupa: Zarejestrowani
Postów: 101
Pomógł: 2
Dołączył: 25.09.2007

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


  1. <div>
  2. <label for="content">Załączik 1</label>
  3. <input type="file" name="_file_1" id="_file_1" value="" class="input">
  4. </div>
  5. <div id="file2" style="display: none">
  6. <label for="content">Załączik 2</label>
  7. <input type="file" name="_file_2" id="_file_2" value="" class="input">
  8. </div>

Jeśli mamy taki kod co należy dorobić aby po dodaniu elementu pokazał sie div id=file2

Ten post edytował pacior 25.09.2007, 12:30:51
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
emacieka
post
Post #2





Grupa: Zarejestrowani
Postów: 40
Pomógł: 1
Dołączył: 29.12.2003
Skąd: Szczecin

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


  1. <div>
  2. <label for="content">Załączik 1</label>
  3. <input type="file" name="_file_1" id="_file_1" value="" class="input" onChange="showInputFile(this, 'file2')">
  4. </div>
  5. <div id="file2" style="display: none">
  6. <label for="content">Załączik 2</label>
  7. <input type="file" name="_file_2" id="_file_2" value="" class="input">
  8. </div>
  9. function showInputFile( input, divID )
  10. {
  11. if ( input.value != '')
  12. {
  13. document.getElementById( divID ).style.display = 'block';
  14. }
  15. }


--------------------
''' ... Among the blind one eyed man is a king ... '''
Go to the top of the page
+Quote Post

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 Aktualny czas: 21.08.2025 - 17:47