03-02-2012, 16:57
Witam,
Mam problem ze skryptem, nie pokazuję i komunikatu ze nie jest wybrany „rodzaj’, „odbiór” i „wysyłka”. Proszę o pomoc w rozwiązaniu problemu. Z góry dziękuje za pomoc.
Pozdrawia
Adziozone
----------------
<title></title>
</head>
<body bgcolor="#ffffff" oncontextmenu="return false" >
<script LANGUAGE="JavaScript">
<!--
function resetform() {
document.forms[0].elements[1]="";
}
function submitForms() {
if (isRodzaj() && isSztuk() && isAmail() && isImie() && isNazwisko() && isAdres() && isMie() && isKod() && isOdbior() )
if (confirm("\n Czy napewno zamierzasz podać swój adres e-mail?"))
{
alert("\nTwoje dane zostaną teraz wysłane. \n\n Użyj przycisku RETURN gdy formularz zostanie wysłany i zechcesz powrócic do mojej strony głównej.\n\n\n Dziękuję za subskrybcję.");
return true;
}
else
{
alert("\n Czy chcesz anulować subskrybcję?");
return false
}
else
return false;
}
function isRodzaj() {
if (document.forms[0].elements[1].value == "")
{
alert ("\n Nie wpisałeś rodzaj. \n\n Proszę o uzupełnienie danych.")
document.forms[0].elements[1].focus();
return false;
}
return true;
}
function isSztuk() {
if (document.forms[0].elements[2].value == "") {
alert ("\n Nie wpisałeś ilości. \n\nProsze o uzupełnienie danych.")
document.forms[0].elements[2].focus();
return false;
}
return true;
}
function isAmail() {
if (document.forms[0].elements[3].value == '') {
alert ("\n Brak adresu e-mail. \n\n Proszę o uzupełnienie.")
document.forms[0].elements[3].focus();
return false;
}
if (document.forms[0].elements[3].value.indexOf ('@',0) == -1 ||
document.forms[0].elements[3].value.indexOf ('.',0) == -1) {
alert ("\n Błąd w adresie e-mail - \"@\" lub \".\"\nProsze wpisać adres e-mail ponownie.")
document.forms[0].elements[3].select();
document.forms[0].elements[3].focus();
return false;
}
return true;
}
function isImie() {
if (document.forms[0].elements[4].value == "") {
alert ("\n Nie pomałeś imienia. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[4].focus();
return false;
}
return true;
}
function isNazwisko()
{
if (document.forms[0].elements[5].value == "")
{
alert ("\n Nie podałerś nazwiska. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[5].focus();
return false;
}
return true;
}
function isAdres() {
if (document.forms[0].elements[6].value == "") {
alert ("\n Nie wpisałeś adresu.\n\nProszę, uzupełnij dane.")
document.forms[0].elements[6].focus();
return false;
}
return true;
}
function isMie() {
if (document.forms[0].elements[7].value == "") {
alert ("\n Nie wpisałeś nazwy miejscowości w adresie. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[7].focus();
return false;
}
return true;
}
function isKod() {
if (document.forms[0].elements[8].value == "") {
alert ("\n Nie wpisałeś kodu pocztowego. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[8].focus();
return false;
}
return true;
}
function isOdbior() {
if (document.forms[0].elements[9].value == "") {
alert ("\n Nie wpisałeś sposobu odostawy. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[9].focus();
return false;
}
return true;
}
// -->
</SCRIPT>
<FORM enctype="text/plain" name="addform" method='post'
action="mailto:[email protected]" onSubmit="return submitForms()">
<div align="center">
<input type="hidden" name="Form" value="Submit Sub">
</div>
<TABLE border=0 cellspacing=0 cellpadding=1 bgcolor="" align="center" >
<TD width="120" height="30"> <font face="arial" size="2">Rodzaj:</font> </TD>
<TD>
<!-- <input type=text name="First Name" size=30,1 maxlength=80> -->
<select name="rodzaj[]">
<option name="wymierz[]">wybierz</option>
<option name="biały[]">1</option>
<option name="zółty[]">2</option>
<option name="zielony[]">3</option>
<option name="granatowy[]">4</option>
<option name="czarny[]">5</option>
<option name="magiczny[]">6</option>
</select>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Sztuk:</font> </TD>
<TD>
<input type=text name="Sztuk" size=10,1 maxlength=80> <font face="arial" size="2">szt.</font>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">e-mail:</font> </TD>
<TD>
<input type=text name="Emai" size=30,1 maxlength=80 size="2">
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Imie:</font> </TD>
<TD>
<input type=text name="Imie" size=30,1 maxlength=80>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Nazwisko:</font> </TD>
<TD>
<input type=text name="Nazwisko" size=30,1 maxlength=80>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Adres:</font> </TD>
<TD>
<input type=text name="Adres" size=30,1 maxlength=25>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Miejscowość:</font> </TD>
<TD>
<input type=text name="Miejscowość" size=30,1 maxlength=35>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Kod pocztowy:</font> </TD>
<TD>
<input type=text name="Kod pocztowy" size=30,1 maxlength=35>
</td></tr>
<TR>
<TD height="30"> <font face="arial" size="2">Odbiór:</font> </TD>
<TD>
<input type="radio" name="platnosc[]"> <font color="#000000" size="2">Osobiście
<input type="radio" name="platnosc[]"> <font color="#000000" size="2">Wysyłka
</td></tr>
<TR>
<TD height="30"> <font face="arial" size="2">Wysyłka:</font> </TD>
<TD>
<input type="radio" name="wysylka[]"> <font color="#000000" size="2">Poczta
<input type="radio" name="wysylka[]"> <font color="#000000" size="2">Kurier
</td></tr>
</tbody>
</table>
<br>
<center>
<input type="submit" value=" Wyślij">
<input type="button" value=" Cofnij " onclick="window.location='http://www.netdesign.beep.pl'">
<input type="reset" value="Wyczyść formularz" onclick=resetform()>
</center></FORM>
Mam problem ze skryptem, nie pokazuję i komunikatu ze nie jest wybrany „rodzaj’, „odbiór” i „wysyłka”. Proszę o pomoc w rozwiązaniu problemu. Z góry dziękuje za pomoc.
Pozdrawia
Adziozone
----------------
<title></title>
</head>
<body bgcolor="#ffffff" oncontextmenu="return false" >
<script LANGUAGE="JavaScript">
<!--
function resetform() {
document.forms[0].elements[1]="";
}
function submitForms() {
if (isRodzaj() && isSztuk() && isAmail() && isImie() && isNazwisko() && isAdres() && isMie() && isKod() && isOdbior() )
if (confirm("\n Czy napewno zamierzasz podać swój adres e-mail?"))
{
alert("\nTwoje dane zostaną teraz wysłane. \n\n Użyj przycisku RETURN gdy formularz zostanie wysłany i zechcesz powrócic do mojej strony głównej.\n\n\n Dziękuję za subskrybcję.");
return true;
}
else
{
alert("\n Czy chcesz anulować subskrybcję?");
return false
}
else
return false;
}
function isRodzaj() {
if (document.forms[0].elements[1].value == "")
{
alert ("\n Nie wpisałeś rodzaj. \n\n Proszę o uzupełnienie danych.")
document.forms[0].elements[1].focus();
return false;
}
return true;
}
function isSztuk() {
if (document.forms[0].elements[2].value == "") {
alert ("\n Nie wpisałeś ilości. \n\nProsze o uzupełnienie danych.")
document.forms[0].elements[2].focus();
return false;
}
return true;
}
function isAmail() {
if (document.forms[0].elements[3].value == '') {
alert ("\n Brak adresu e-mail. \n\n Proszę o uzupełnienie.")
document.forms[0].elements[3].focus();
return false;
}
if (document.forms[0].elements[3].value.indexOf ('@',0) == -1 ||
document.forms[0].elements[3].value.indexOf ('.',0) == -1) {
alert ("\n Błąd w adresie e-mail - \"@\" lub \".\"\nProsze wpisać adres e-mail ponownie.")
document.forms[0].elements[3].select();
document.forms[0].elements[3].focus();
return false;
}
return true;
}
function isImie() {
if (document.forms[0].elements[4].value == "") {
alert ("\n Nie pomałeś imienia. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[4].focus();
return false;
}
return true;
}
function isNazwisko()
{
if (document.forms[0].elements[5].value == "")
{
alert ("\n Nie podałerś nazwiska. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[5].focus();
return false;
}
return true;
}
function isAdres() {
if (document.forms[0].elements[6].value == "") {
alert ("\n Nie wpisałeś adresu.\n\nProszę, uzupełnij dane.")
document.forms[0].elements[6].focus();
return false;
}
return true;
}
function isMie() {
if (document.forms[0].elements[7].value == "") {
alert ("\n Nie wpisałeś nazwy miejscowości w adresie. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[7].focus();
return false;
}
return true;
}
function isKod() {
if (document.forms[0].elements[8].value == "") {
alert ("\n Nie wpisałeś kodu pocztowego. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[8].focus();
return false;
}
return true;
}
function isOdbior() {
if (document.forms[0].elements[9].value == "") {
alert ("\n Nie wpisałeś sposobu odostawy. \n\nProszę, uzupełnij dane.")
document.forms[0].elements[9].focus();
return false;
}
return true;
}
// -->
</SCRIPT>
<FORM enctype="text/plain" name="addform" method='post'
action="mailto:[email protected]" onSubmit="return submitForms()">
<div align="center">
<input type="hidden" name="Form" value="Submit Sub">
</div>
<TABLE border=0 cellspacing=0 cellpadding=1 bgcolor="" align="center" >
<TD width="120" height="30"> <font face="arial" size="2">Rodzaj:</font> </TD>
<TD>
<!-- <input type=text name="First Name" size=30,1 maxlength=80> -->
<select name="rodzaj[]">
<option name="wymierz[]">wybierz</option>
<option name="biały[]">1</option>
<option name="zółty[]">2</option>
<option name="zielony[]">3</option>
<option name="granatowy[]">4</option>
<option name="czarny[]">5</option>
<option name="magiczny[]">6</option>
</select>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Sztuk:</font> </TD>
<TD>
<input type=text name="Sztuk" size=10,1 maxlength=80> <font face="arial" size="2">szt.</font>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">e-mail:</font> </TD>
<TD>
<input type=text name="Emai" size=30,1 maxlength=80 size="2">
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Imie:</font> </TD>
<TD>
<input type=text name="Imie" size=30,1 maxlength=80>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Nazwisko:</font> </TD>
<TD>
<input type=text name="Nazwisko" size=30,1 maxlength=80>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Adres:</font> </TD>
<TD>
<input type=text name="Adres" size=30,1 maxlength=25>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Miejscowość:</font> </TD>
<TD>
<input type=text name="Miejscowość" size=30,1 maxlength=35>
</TD></TR>
<TR>
<TD height="30"> <font face="arial" size="2">Kod pocztowy:</font> </TD>
<TD>
<input type=text name="Kod pocztowy" size=30,1 maxlength=35>
</td></tr>
<TR>
<TD height="30"> <font face="arial" size="2">Odbiór:</font> </TD>
<TD>
<input type="radio" name="platnosc[]"> <font color="#000000" size="2">Osobiście
<input type="radio" name="platnosc[]"> <font color="#000000" size="2">Wysyłka
</td></tr>
<TR>
<TD height="30"> <font face="arial" size="2">Wysyłka:</font> </TD>
<TD>
<input type="radio" name="wysylka[]"> <font color="#000000" size="2">Poczta
<input type="radio" name="wysylka[]"> <font color="#000000" size="2">Kurier
</td></tr>
</tbody>
</table>
<br>
<center>
<input type="submit" value=" Wyślij">
<input type="button" value=" Cofnij " onclick="window.location='http://www.netdesign.beep.pl'">
<input type="reset" value="Wyczyść formularz" onclick=resetform()>
</center></FORM>