Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> AJAX - podwójna akcja inputa
paciek
post
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 29.06.2010

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


Witam! Czy jest możliwość wykonania podwójnej akcji w inpucie. Siedzę nad tym od wczoraj i nadal nie rozwiązałem problemu.
Jeden skrypt wywołuje się na moim serwerze drugi natomiast na zewnętrznym:

  1. <form action="index.php?register=adduser" method="post">
  2. <input type="hidden" name="refdb" value="'.$ref['user'].'" />
  3. <input type="text" name="user" placeholder="Podaj imię i nazwisko">
  4. <input type="text" name="tel" placeholder="Podaj telefon (w formacie 222 333 444)">
  5. <input type="text" name="email" placeholder="Podaj maila">
  6. <input type="submit" value="Zarejestruj mnie" id="mc-embedded-subscribe" class="submit pointer_cursor">
  7. </form>


  1. <form method="post" action="http://www.mail.s7team.com/form.php?form=59" id="frmSS59" onsubmit="return CheckForm59(this);">


Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
owca_82
post
Post #2





Grupa: Zarejestrowani
Postów: 77
Pomógł: 8
Dołączył: 22.04.2012

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


Oczywiście że można - najpierw żeby dobrać się do pierwszego skryptu korzystasz z ajaxa (onsubmit -> AJAX -> pierwszy skrypt) , a drugie wywołanie pozostawiasz bez zmian
Go to the top of the page
+Quote Post
paciek
post
Post #3





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 29.06.2010

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


Znalazłem taki kawałek kodu:

  1. // JavaScript
  2. var idButtona = "...";
  3. document.getElementsById(idButtona).onClick = function(){
  4. document.getElementsById('formularz').action = 'jakasinnaakcja.php';
  5. document.getElementsById('formularz').submit();
  6. }


Czy robiąc:

  1. <form action="http://www.mail.s7team.com/form.php?form=59" id="frmSS59" onsubmit="return CheckForm59(this); method="post">
  2. <input type="hidden" name="refdb" value="'.$ref['user'].'" />
  3. <input type="text" name="user" placeholder="Podaj imię i nazwisko">
  4. <input type="text" name="tel" placeholder="Podaj telefon (w formacie 222 333 444)">
  5. <input type="text" name="email" placeholder="Podaj maila">
  6. <input type="submit" value="Zarejestruj mnie" id="mc-embedded-subscribe" class="submit pointer_cursor" id="ok">
  7. </form>


  1. // JavaScript
  2. var ok = "...";
  3. document.getElementsById('ok').onClick = function(){
  4. document.getElementsById('frmSS59').action = 'index.php?register=adduser';
  5. document.getElementsById('frmSS59').submit();
  6. }


Powinno wszystko działać?
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 - 15:37