Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> emulacja .click() lub .submit() w Safart
atomix1040
post 28.06.2007, 15:36:28
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 13.04.2007

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


Jako ze ostatnio apple wypuscilo Safari pod wine a jestem w trakcie pisania proejktu webowego, probuje zrobic kompatybilnosc takze z Safari. Wiele problemow ominalem ale jedngo nie moge.
Kod
<form target="nazwaIframe">
  <input type="file" />
  <input type="submit" />
</form>

dziala chetnie, jednak
Kod
<form target="nazwaIframe" onsubmit="document.getElementById('submitButton').click()">
  <input type="file" />
  <input type="button" id="submitButton" />
</form>

<!-- lub -->

<form name="uploadForm" target="nazwaIframe" onsubmit="document.uploadForm.submit()">
  <input type="file" />
</form>

juz nie chca dzialac. Ten skrypt jest uploadem plikow z progress barem, dziala Opera IE (>=6) FF, ale Safar i nie bardzo (oczywiscie wszystkie pola sa zdefiniowane zgodnie z XHTML czyli enctype id i tak dalej to jest tylko przyklad). Ktos wie dlaczego Safari ma problemy z submitem formularzy z JS ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
abc667
post 28.06.2007, 15:43:47
Post #2





Grupa: Zarejestrowani
Postów: 229
Pomógł: 0
Dołączył: 29.05.2007

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


onsubmit="document.uploadForm.submit()"

trochę tego nie rozumiem?
kiedy wysyłasz form to znowu chcesz to wysłać?
Go to the top of the page
+Quote Post
atomix1040
post 28.06.2007, 17:57:42
Post #3





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 13.04.2007

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


nie no to ewidentny blad z glowy pisalem
chodzil o

Kod
<form name="uploadForm" target="nazwaIframe" >
  <input type="file" />
  <input type="button" onclick="document.uploadForm.submit()" />
</form>

<!-- lub --> <a onclick="document.uploadForm.submit()">send</a>


sorry za blad.
Go to the top of the page
+Quote Post
abc667
post 28.06.2007, 18:01:11
Post #4





Grupa: Zarejestrowani
Postów: 229
Pomógł: 0
Dołączył: 29.05.2007

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


  1. <form name="uploadForm" id="formularz" target="nazwaIframe" >
  2. <input type="file" />
  3. <input type="button" onclick="document.getElementById('formularz').submit()" />
  4. </form>
  5.  
  6. lub
  7.  
  8. onclick="document.forms['uploadForm'].submit()"
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 Wersja Lo-Fi Aktualny czas: 25.07.2025 - 10:08