dworak16
21.05.2011, 14:35:53
Witam
Na stronie
http://www.skrypty.tibianeobot.com.pl/html/zrobwt.htmlMam formularz niestety nie wiem co trzeba dodać aby sprawdzał on czy wszystkie pola zostały wypełnione i jeżeli nie to żeby wyskakiwało takie Okienko Pop Oup z tym które pola nie zostały wypełnione
czy ktoś mógłby mi z tym pomóc?
Pozdrawiam
plej
21.05.2011, 14:37:33
a może byś wkleił tu kod skryptu?
dworak16
21.05.2011, 16:01:09
można wejść w kod źródłowy strony i widać no ale wkleję

<FORM action="http://www.skrypty.tibianeobot.com.pl/mail.php" method="POST" onsubmit="return validate(this);;"><input type="hidden" name="userid" value="70595368"><input type="hidden" name="csvFilename" value="FWFORBIDDEN-WEBPROTECT-worldtrade-output"><span class="formSpan"><div style="text-align: center;"><div style="text-align: center;"><font size="4"><span style="font-weight: bold; color: black; font-family: verdana;"></span></font><b><font size="7" color="black" face="Impact"><span class="fw_link_website">MAKE A WORLD TRADE
<br><br></span></font></b><span class="formSpan"><font size="2"><span style="font-weight: bold; color: black;">Orders made through the website can take up to 24 hours to be processed
</span></font></span><font style="color: aliceblue;" size="2"><br></font><br></div><table style="width: 472px; height: 200px; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="text-align: center;"><font style="background-color: transparent; color: Blue;" size="2"><span style="font-weight: bold;">Fee
</span></font><font size="2"><br></font></td><td style="text-align: center;"><font size="2"><span style="font-weight: bold; color: green;">Your
</span><span style="font-weight: bold; color: green;">Optional
</span><span style="font-weight: bold; color: green;">Pvp
</span><br></font></td><td style="text-align: center;"><font size="2"><span style="color: blue; font-weight: bold;">Your Open
</span><span style="color: blue; font-weight: bold;">Pvp
</span><br></font></td><td style="text-align: center;"><font size="2"><span style="color: red; font-weight: bold;">Your
</span><span style="color: red; font-weight: bold;"> Hardcore Pvp
</span><br></font></td></tr><tr><td style="text-align: center;"><font size="2"><span style="font-weight: bold; color: green;">My
</span><span style="font-weight: bold; color: green;"> Optional Pvp
</span><br></font></td><td style="text-align: center; color: black;"><font size="1"><b>1:1.5
</b></font> <font size="1"><br>(my 100k for your 150k)
</font></td><td style="text-align: center; color: black;"><font size="1"><b>1:1.1
<br></b></font><font size="1">(my 100k for your 110k)
</font></td><td style="text-align: center; color: black;"><font size="1"><b>1:1
</b></font> <font size="1"><br></font><font size="1">(my 100k for your 100k)
</font></td></tr><tr><td style="text-align: center;"><font size="2"><span style="color: blue; font-weight: bold;">My
</span><span style="color: blue; font-weight: bold;"> Open
</span><span style="color: blue; font-weight: bold;">Pvp
</span><br></font></td><td style="text-align: center; color: black;"><font size="1"><b>1:2.5
</b></font><font size="1"><br></font><font size="1">(my 100 for your 250k)
<br></font></td><td style="text-align: center; color: black;"><font size="1"><b>1:1.5
</b><br> </font><font size="1">(my 100k for your 150k)
</font></td><td style="text-align: center; color: black;"><font size="1"><b>1:1
</b></font> <font size="1"><br></font><font size="1">(my 100k for your 100k)
</font></td></tr><tr><td style="text-align: center;"><font size="2"><span style="color: red; font-weight: bold;">My
</span><span style="color: red; font-weight: bold;"> Hardcore Pvp
</span><br></font></td><td style="text-align: center; color: black;"><font size="1"><b>1:3
</b><br> (
</font><font size="1">my 100k for your 300k)
</font></td><td style="text-align: center; color: black;"><font size="1"><b>1:2
</b></font> <font size="1"><br>(
</font><font size="1">my 100k for your 200k)
</font></td><td style="text-align: center; color: black;"><font size="1"><b>1:1.1
</b><br> (
</font><font size="1">my 100k for your 120k)
</font></td></tr></tbody></table><br style="font-family: verdana; color: white;"><div style="text-align: left; color: crimson; font-family: verdana;"><span style="font-weight: bold; color: white;"><br></span><span style="font-weight: bold; text-decoration: underline; color: red;">Rules:
</span><ul style="color: black;"><li><font size="2"><span style="font-weight: bold;"></span></font><font style="color: black;" size="2"><span style="font-weight: bold;">Minimum amount to world trade is 100k
</span></font></li><li><font size="2"><span style="font-weight: bold;">DO NOT
</span> use these forms as a method to contact us.
</font></li><li><font size="2">To get in touch with me, add
<span style="font-weight: bold;">dworak16@o2.pl
</span> to MSN.
</font></li></ul><br style="color: black;"><br style="color: black;"><span style="font-weight: bold; text-decoration: underline; color: red;">How to make a World Trade:
</span><br style="color: black;"></div><div style="text-align: justify; color: black;"><ol style="color: black; font-family: verdana;"><li><font size="2">Check
<a style="font-weight: bold;" name="" href="http://www.skrypty.tibianeobot.com.pl/stangp.html">Stock and Chars
</a> to find out how much money we have and our character names.
<br></font></li><li><font size="2">Use the
<a style="font-weight: bold;" href="http://www.skrypty.tibianeobot.com.pl/kalkulator.html">WT Calculator
</a> to see how much you will get.
<br></font></li><li><font size="2">Parcel us the money to our character on your server / Thais.
<br></font></li><li><font size="2">Fill out the form with the correct information
<br></font></li><li><font size="2">Only send the form
<span style="font-weight: bold;">AFTER
</span> you sent the cash.
</font></li></ol><br><br><span style="font-weight: bold; font-family: verdana; text-decoration: underline; color: white;"></span></div></div></span> <table border="2" cellpadding="10" rules="all" width="450" height="20"> <th>Payment Information
</th> <form action="mail.php" method="post"> <b>*Select the server where you sent the cash from:
</b> <option value="Aldora" >Aldora
<b>*Your character name:
</b><br>
<input name="charname" />
<b>*How much do you want to WT?
</b><br>
<input name="ammountwt" />
<table border="2" cellpadding="10" rules="all" width="450" height="20"> <th>Delivery Information
</th> <form action="mail.php" method="post"> <b>*Select the server where you want your money:
</b> <option value="Aldora" >Aldora
<b>*Your character name:
</b><br>
<input name="charnameback" />
<option value="Ab'dendriel" >Ab'dendriel
<b>*E-mail adress
</b><br>
<input type="submit" value="Wyślij"/>
mat-bi
21.05.2011, 16:08:14
Eee, operacje na DOM-ie, sprawdzanie value, dodawanie kolejnych elementów, alert? MOże wykorzystaj jQuery
dworak16
23.05.2011, 11:38:57
może jakiś konkretny przykład z jednym polem z mojego formularza i dalej sobie poradzę?

Z góry dziękuję
Bump
mat-bi
23.05.2011, 11:43:26
No kurde, bozia rączek nie dała, sam nei potrafisz nic znaleźć?
http://webcloud.se/log/Form-validation-wit...y-from-scratch/Przykład z tutorialów, radź sobie sam, ja nie rozdaję gotowców.
dworak16
4.06.2011, 09:32:55
gdybym znalazł nie pytał bym tutaj, nie jestem obeznany w tym temacie tak jak Wy dlatego pytam, chyba po to jest to forum czy nie? Jeżeli nie to przepraszam że założyłem tutaj konto i zapytałem,
pozdro
Bump!!
zawodnik
4.06.2011, 12:18:16
sprawdzasz, czy zawartość value danego pola ma wartość '', jeśli tak, to znaczy że jest puste
np.
var input1 = document.getElementById('input1').value;
if(input1 == '')
{
alert('Nie wypełniłeś pola!');
}
else{
alert('ok');
}
Powinno działać w przypadku pól tekstowych, przy użyciu <option> sprawdzasz:
var input1 = document.getElementById('input1');
if(input1.checked == true){
alert('zaznaczyłeś pole');
}
else{
alert('Zaznacz pole!');
}
w razie niejasności pisz na PW