Posiadam taki kod w sekcji HEAD:
Kod
<script type="text/javascript">
function error(tekst) {
if (errfound) return;
window.alert(tekst);
errfound = true;
}
function validate() {
errfound = false;
var bledy = "";
with (document.forms[0]) {
if (imie.value == "") bledy += "Nie podałeś imienia. \n";
if (bledy != "") error(bledy);
}
return !errfound;
}
</script>
function error(tekst) {
if (errfound) return;
window.alert(tekst);
errfound = true;
}
function validate() {
errfound = false;
var bledy = "";
with (document.forms[0]) {
if (imie.value == "") bledy += "Nie podałeś imienia. \n";
if (bledy != "") error(bledy);
}
return !errfound;
}
</script>
Oraz w body:
I wszystko jest Ok.... dopóki nad formularzem nie umieszczę drugiego formularza.
Całość wtedy wygląda tak:
<div style="background-color:#0F0B16;"> <form style="margin-top:5px;" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_donations"> <input type="hidden" name="business" value="mumiok1@gmail.com"> <input type="hidden" name="item_name" value="...A"> <input name="cn" style="width:150px;" onfocus="this.select()" value="Tu wpisz nick lub imię" type="text"> Kwota: <input type="text" style="width:100px;" name="amount" value="0.01"> PLN <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="PLN"> <input type="hidden" name="tax" value="0"> <input type="hidden" name="lc" value="PL"> <input type="hidden" name="bn" value="PP-DonationsBF"> <input type="submit" value="Wpłać!" border="0" name="submit" alt="PayPal - Wygodne i bezpieczne płatności internetowe!"> </form> </div> <form action="skrypt.php" method="post" onsubmit="return validate();"> <input type="submit" value="wyślij" /> </form> <br>
Wtedy walidacja formularza nie działa ;(
Co jest ? ;(
