Visualizzazione dei risultati da 1 a 2 su 2

Discussione: JS e Iframe

  1. #1
    Utente di HTML.it L'avatar di thitan
    Registrato dal
    Feb 2001
    Messaggi
    716

    JS e Iframe

    io ho due pagine, la 'madre':
    Codice PHP:
    [html]
    <
    script>
    function 
    Prova(valore){
        
    alert(valore);
    }
    </script>
    <iframe src="figlia.php" style=""></iframe>
    [/html] 
    e la 'figlia':
    Codice PHP:
    [html]
    <form action="figlia.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
      <input type="text" name="textfield" />
      <input type="submit" name="Submit" value="Invia" />
    </form>
    <?
    if(isset($_POST["textfield"])){
        
    $var=$_POST["textfield"];
        echo 
    "<script>
    window.onload = Prova('
    $var');
    </script>"
    ;
    }
    ?>
    [/html]
    ora io ho bisogno che se la figlia riceve il post, mi lanci una funzione js che però è nel codice della pagina madre (funzione Prova(valore)).

    se la funzione la metto nella pagina figlia funziona correttamente, se nella madre non riesce a individuarla..

    c'è un modo?

    www.inter-rail.it
    travellers, not tourist
    Is cuma cá mhinice a théann tú ar strae; is é is tábhachtaí gurb áil leat do bhealach a aimsiú arís.

  2. #2
    Utente di HTML.it L'avatar di thitan
    Registrato dal
    Feb 2001
    Messaggi
    716
    ok
    al posto dell'iframe uso un pop up e ho bello che risolto

    www.inter-rail.it
    travellers, not tourist
    Is cuma cá mhinice a théann tú ar strae; is é is tábhachtaí gurb áil leat do bhealach a aimsiú arís.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.