Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Select onchange

  1. #1
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712

    Select onchange

    Qualcuno sa dirmi cosa sbaglio? non funziona!

    Codice PHP:
    echo "<form method=\"post\" action=\"utp_stato_mod.php4\">";
    echo 
    "<select  name=\"stato\" class=\"formsel\" onChange=\"this.form.submit()';\">";
        while (list(
    $key$value) = each($arrstd))
        {
        echo 
    "<option value=\"$key\"";
        if (
    $key == $_POST[stato])
        echo 
    " selected";
        echo 
    ">$value</option>";
        }
    echo 
    "</select></form>"
    Ubuntu 10.10 x86_64

  2. #2
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    ottieni warning?? notice?? devi sempre indicare cosa non funziona
    think simple think ringo

  3. #3
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712
    Originariamente inviato da marketto
    ottieni warning?? notice?? devi sempre indicare cosa non funziona
    Niente, non mi da errori, se seleziono una voce dalla select non cambia niente.
    Ubuntu 10.10 x86_64

  4. #4
    codice:
    echo "<select  name=\"stato\" class=\"formsel\" onChange=\"this.form.submit()';\">"
    Forse hai un apice di troppo dopo this.form.submit()....

    codice:
    echo "<select  name=\"stato\" class=\"formsel\" onChange=\"this.form.submit();\">"

  5. #5
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712
    Originariamente inviato da magò11
    codice:
    echo "<select  name=\"stato\" class=\"formsel\" onChange=\"this.form.submit()';\">"
    Forse hai un apice di troppo dopo this.form.submit()....

    codice:
    echo "<select  name=\"stato\" class=\"formsel\" onChange=\"this.form.submit();\">"
    Hai ragione, grazie mille!
    Ubuntu 10.10 x86_64

  6. #6
    e un paio di ' ' in meno
    $_POST[stato] => $_POST['stato'] altrimenti potresti ottenere un warning

  7. #7
    Utente di HTML.it L'avatar di maxtn
    Registrato dal
    Jul 2002
    Messaggi
    712
    E se voglio specificare l'action senza metterlo in <form action=.... ?

    Così non mi funziona:

    <select name="stato" class="formsel" onChange="this.form.action='utp_stato_mod.php4';">
    Ubuntu 10.10 x86_64

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.