Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][JavaScript] Automatyczne submit'owanie formularza
parzygnat
post
Post #1





Grupa: Zarejestrowani
Postów: 155
Pomógł: 6
Dołączył: 31.12.2007
Skąd: Poznań

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


Witam czy taki formularz, oczywiście po przeróbkach, może się submit'ować po wybraniu pliku do transferu? Bez klikania w button "Zapisz zdjecie"?

  1. <?php
  2. print "<form enctype=\"multipart/form-data\" action=\"koszyk.php\" method=\"POST\">";
  3.  print "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2048000\" />";
  4.  print "<input type=\"hidden\" name=\"menu\" value=\"upload\" />";  print "<input type=\"hidden\" name=\"klucz1\" value=\"$klucz1\" />";
  5.  print "<input type=\"hidden\" name=\"klucz2\" value=\"$klucz2\" />";
  6.  print "<input name=\"userfile\" type=\"file\" class=\"opisy_10\" />";
  7.  print "<input name=\"location\" type=\"hidden\" value=\"/home/stronki/upload/\" />";
  8.  print "&nbsp&nbsp";
  9.  print "<input type=\"submit\" value=\"Zapisz plik\" class=\"opisy_10\" />";
  10. print "</form>";
  11. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
MiFlo
post
Post #2





Grupa: Zarejestrowani
Postów: 92
Pomógł: 4
Dołączył: 12.09.2006
Skąd: 127.0.0.1

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


To na twoim skrypcie wygladać bedzie tak:
  1. <?php
  2. print "<form name=\"form\" enctype=\"multipart/form-data\" action=\"koszyk.php\" method=\"POST\">";
  3.  print "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2048000\" />";
  4.  print "<input type=\"hidden\" name=\"menu\" value=\"upload\" />";  print "<input type=\"hidden\" name=\"klucz1\" value=\"$klucz1\" />";
  5.  print "<input type=\"hidden\" name=\"klucz2\" value=\"$klucz2\" />";
  6.  print "<input name=\"userfile\" onKeyUp="javascript: form.Submit();" type=\"file\" class=\"opisy_10\" />";
  7.  print "<input name=\"location\" type=\"hidden\" value=\"/home/stronki/upload/\" />";
  8.  print "&nbsp&nbsp";
  9.  print "<input type=\"submit\" value=\"Zapisz plik\" class=\"opisy_10\" />";
  10. print "</form>";
  11. ?>

Jak nie onKeyUp to coś innego, wpisalem to bo mysle że będzie dzialać aczkolwiek jeżeli nie to:

onblur - gdy pole przestaje być aktywne
onfocus - gdy pole formularza zostaje uaktywniona
onchange - po zmianie wartości pola
onreset - gdy wartości formularza zostaną zresetowane
onsubmit - gdy formularz zostanie wysłany

Pozdrawiam
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 5.10.2025 - 18:15