Czy da się tak zrobić, żeby w formularzu po przyciśnięciu klawisza button przekazane zostały wartości 2 i więcej zmiennych?
pozdrawiam Jola
Dzięki temu rozpoznasz jaki submit został kliknięty i w zależności od potrzeb obrobisz interesujące Cię pola. To co możesz jeszcze ewentualnie dodatkowo to używając JavaScript w momencie kliknięcia buttona sprawdzić po stronie przeglądarki czy wypełnił wymagane pola. Ale na serwerze i tak to samo musisz zrobić, bo mógł wypełnić pola głupotami i będziesz miała problem.
document.getElementById("miasto").disabled = !document.getElementById("miasto").disabled; document.getElementById("kod_pocztowy").disabled = !document.getElementById("kod_pocztowy").disabled; document.getElementById("telefon").disabled = !document.getElementById("telefon").disabled; document.getElementById("gg").disabled = !document.getElementById("gg").disabled; document.getElementById("konto_bankowe").disabled = !document.getElementById("konto_bankowe").disabled; document.getElementById("firma_nazwa").disabled = !document.getElementById("firma_nazwa").disabled; document.getElementById("nip").disabled = !document.getElementById("nip").disabled; document.getElementById("regon").disabled = !document.getElementById("regon").disabled; document.getElementById("firma_adres").disabled = !document.getElementById("firma_adres").disabled; document.getElementById("firma_miasto").disabled = !document.getElementById("firma_miasto").disabled; document.getElementById("firma_kod_pocztowy").disabled = !document.getElementById("firma_kod_pocztowy").disabled; document.getElementById("firma_telefon").disabled = !document.getElementById("firma_telefon").disabled; document.getElementById("firma_gg").disabled = !document.getElementById("firma_gg").disabled; document.getElementById("firma_konto_bankowe").disabled = !document.getElementById("firma_konto_bankowe").disabled;' type="checkbox">
<form> <input type="hidden" name="button1_opcja1" value="wartosc" /> <input type="hidden" name="button1_opcja2" value="wartosc2" /> <input type="hidden" name="button2_opcja1" value="wartosc" /> <input type="hidden" name="button2_opcja2" value="wartosc2" /> <input type="button" name="button1" value="Klik1" /> <input type="button" name="button2" value="Klik2" /> </form> <?php // i w php { $opcja1 = $_POST['button1_opcja1']; // itd. } ?>