Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [JavaScript][PHP]rozbudowa formularza...
Forum PHP.pl > Forum > Przedszkole
rumpelek
Witam serdecznie mam gotowy formularz z walidacją po stronie przeglądarki i po stronie serwera... tak naprawdę ja go nie pisałem tylko znalazłem gdzieś het het dalego za siedmioma googlami...

potrzebuję w nim dodać:
1) pole e-mail i jego walidację...
2) kilka pól typu opisowego "Uwagi"... ich wymóg poprawności jest w zasadzie znikomy... chodzi tylko o bezpieczeństwo danych, gdyż w tych polach może się znajdować jakiś długi tekst... ponadto
3) pole typu Uwagi, ale wymagane by w nim znalazło się choć jedno słowo... min. 3 znaki...

PS. jeśli ktoś potrafi przenieść formatowanie do pliku CSS byłbym wdzięczny za pomoc (przykładowe pokazanie co i jak... resztę sam dokończę...)
proszę o pomoc.

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <link href="style.css" type="text/css" rel="stylesheet" />
  5. <script type='text/javascript'>
  6. function validate(type)
  7. {
  8. switch(type)
  9. {
  10. case 0:
  11. if(CheckPESEL())
  12. {
  13. document.getElementById("imie").innerHTML = "<img src='img/tick.gif' /> ";
  14. return true;
  15. }
  16. document.getElementById("imie").innerHTML = "<img src='img/cross.gif' /> ";
  17. break;
  18. case 1:
  19. if(document.getElementById("imie").value.length < 3)
  20. {
  21. document.getElementById("imie_msg").innerHTML = "<img src='img/cross.gif' /> Podane imię jest zbyt krótkie";
  22. return false;
  23. }
  24. else
  25. {
  26. document.getElementById("imie_msg").innerHTML = "<img src='img/tick.gif' /> ";
  27. return true
  28. }
  29. break;
  30. case 2:
  31. if(document.getElementById("nazwisko").value.length < 3)
  32. {
  33. document.getElementById("nazwisko_msg").innerHTML = "<img src='img/cross.gif' /> Podane nazwisko jest zbyt krótkie";
  34. return false;
  35. }
  36. else
  37. {
  38. document.getElementById("nazwisko_msg").innerHTML = "<img src='img/tick.gif' /> ";
  39. return true;
  40. }
  41. break;
  42. case 3:
  43. var id = document.getElementById("tozsamosc_typ").value;
  44. if(id == 0)
  45. {
  46. if(!CheckDOWOD())
  47. {
  48. return false;
  49. }
  50. else
  51. {
  52. return true;
  53. }
  54. }
  55. break;
  56. case 4:
  57. if(document.getElementById("imie_ojca").value.length < 3)
  58. {
  59. document.getElementById("imie_ojca_msg").innerHTML = "<img src='img/cross.gif' /> Podane imię ojca jest zbyt krótkie";
  60. return false;
  61. }
  62. else
  63. {
  64. document.getElementById("imie_ojca_msg").innerHTML = "<img src='img/tick.gif' /> ";
  65. return true;}
  66. break;
  67. case 5:
  68. if(document.getElementById("miejsce_urodzenia").value.length < 3)
  69. {
  70. document.getElementById("miejsce_urodzenia_msg").innerHTML = "<img src='img/cross.gif' /> Podana nazwa miejscowości jest zbyt krótka";
  71. return false;
  72. }
  73. else
  74. {
  75. document.getElementById("miejsce_urodzenia_msg").innerHTML = "<img src='img/tick.gif' /> ";
  76. return true;}
  77. break;
  78. case 6:
  79. if(document.getElementById("ulica").value.length < 3)
  80. {
  81. document.getElementById("ulica_msg").innerHTML = "<img src='img/cross.gif' /> Podana nazwa ulicy jest zbyt krótka";
  82. return false;
  83. }
  84. else
  85. {
  86. document.getElementById("ulica_msg").innerHTML = "<img src='img/tick.gif' /> ";
  87. return true;}
  88. break;
  89. case 7:
  90. if(document.getElementById("nr_lokalu").value.length < 1)
  91. {
  92. document.getElementById("nr_lokalu_msg").innerHTML = "<img src='img/cross.gif' /> Podany numer lokalu jest zbyt krótki";
  93. return false;
  94. }
  95. else
  96. {
  97. document.getElementById("nr_lokalu_msg").innerHTML = "<img src='img/tick.gif' /> ";
  98. return true;}
  99. break;
  100. case 8:
  101. if(!CheckKOD())
  102. {
  103. document.getElementById("kod_pocztowy_msg").innerHTML = "<img src='img/cross.gif' /> Podany kod jest nieprawidłowy. Format: XX-XXX";
  104. return false;
  105. }
  106. else
  107. {
  108. document.getElementById("kod_pocztowy_msg").innerHTML = "<img src='img/tick.gif' /> (XX-XXX)";
  109. return true;}
  110. break;
  111. case 9:
  112. if(document.getElementById("miejscowosc").value.length < 3)
  113. {
  114. document.getElementById("miejscowosc_msg").innerHTML = "<img src='img/cross.gif' /> Podana nazwa miejscowosci jest zbyt krótka";
  115. return false;
  116. }
  117. else
  118. {
  119. document.getElementById("miejscowosc_msg").innerHTML = "<img src='img/tick.gif' /> ";
  120. return true;}
  121. break;
  122. }
  123. return (false);
  124. }
  125.  
  126. function CheckTELEFON()
  127. {
  128. var pattern = /^[0-9]{9}$/
  129. var wynik = str.match(pattern);
  130. if(wynik)
  131. return true;
  132. return false;
  133. }
  134. function CheckKOD()
  135. {
  136. var str = document.getElementById("kod_pocztowy").value;
  137. var pattern = /^[0-9]{2}\-[0-9]{3}$/;
  138. var wynik = str.match(pattern);
  139. if(wynik)
  140. return true;
  141. return false;
  142. }
  143. function CheckPESEL()
  144. {
  145. var str = document.getElementById("pesel").value;
  146. var pattern = /^[0-9]{11}$/;
  147. var wynik = str.match(pattern);
  148. if (!wynik)
  149. {
  150. document.getElementById("pesel_msg").innerHTML = "<img src='img/cross.gif' /> Podany PESEL jest zbyt krótki (Wymagane 11 cyfr)";
  151. return false;
  152. }
  153. var arrSteps = new Array(1, 3, 7, 9, 1, 3, 7, 9, 1, 3);
  154. intSum = 0;
  155. for (var i = 0;i < 10; i++)
  156. {
  157. intSum += arrSteps[i] * str.charAt(i);
  158. }
  159. int = 10 - intSum % 10;
  160. var intControlNr = 0;
  161. if(int != 10)
  162. intControlNr = int;
  163. if (intControlNr == str.charAt(10))
  164. {
  165. document.getElementById("pesel_msg").innerHTML = "<img src='img/tick.gif' /> ";
  166. return true;
  167. }
  168. document.getElementById("pesel_msg").innerHTML = "<img src='img/cross.gif' /> Podany PESEL może być błędny";
  169. return false;
  170. }
  171. function CheckDOWOD(str)
  172. {
  173. var str = document.getElementById("dokument_tozsamosci").value.toUpperCase();
  174. var pattern = /^[A-Z]{3}[0-9]{6}$/
  175. var wynik = str.match(pattern);
  176. if(!wynik)
  177. {
  178. document.getElementById("tozsamosc_msg").innerHTML = "<img src='img/cross.gif' /> Podany numer dowodu jest błędny.";
  179. return false;
  180. }
  181. var arrstr = new Array();
  182. for(var i = 0; i<10; i++)
  183. {
  184. arrstr[i] = str.charAt(i);
  185. if(i < 3)
  186. arrstr[i] = str.charAt(i).charCodeAt(0) - 55;
  187. }
  188. arrSteps = new Array(7, 3, 1, 0, 7, 3, 1, 7, 3, 1);
  189. var intSum = 0;
  190. for (var i = 0; i < 10; i++)
  191. {
  192. intSum += arrSteps[i] * arrstr[i];
  193. }
  194. var int = intSum % 10;
  195. var intControlNr = 0;
  196. if(int != 10)
  197. var intControlNr = int;
  198. if (intControlNr == arrstr[3])
  199. {
  200. document.getElementById("tozsamosc_msg").innerHTML = "<img src='img/tick.gif' />";
  201. return true;
  202. }
  203. else
  204. {
  205. document.getElementById("tozsamosc_msg").innerHTML = "<img src='img/cross.gif' /> Podany numer dowodu jest nieprawidłowy";
  206. return false;
  207. }
  208. }
  209. function sprc()
  210. {
  211. if(document.getElementById("spr").checked)
  212. {
  213. document.getElementById("pesel").disabled=false;
  214. document.getElementById("imie").disabled=false;
  215. document.getElementById("nazwisko").disabled=false;
  216. document.getElementById("tozsamosc_typ").disabled=false;
  217. document.getElementById("dokument_tozsamosci").disabled=false;
  218. document.getElementById("imie_ojca").disabled=false;
  219. document.getElementById("miejsce_urodzenia").disabled=false;
  220. document.getElementById("ulica").disabled=false;
  221. document.getElementById("nr_lokalu").disabled=false;
  222. document.getElementById("kod_pocztowy").disabled=false;
  223. document.getElementById("miejscowosc").disabled=false;
  224. }
  225. else
  226. {
  227. document.getElementById("pesel").disabled=true;
  228. document.getElementById("imie").disabled=true;
  229. document.getElementById("nazwisko").disabled=true;
  230. document.getElementById("tozsamosc_typ").disabled=true;
  231. document.getElementById("dokument_tozsamosci").disabled=true;
  232. document.getElementById("imie_ojca").disabled=true;
  233. document.getElementById("miejsce_urodzenia").disabled=true;
  234. document.getElementById("ulica").disabled=true;
  235. document.getElementById("nr_lokalu").disabled=true;
  236. document.getElementById("kod_pocztowy").disabled=true;
  237. document.getElementById("miejscowosc").disabled=true;
  238. }
  239. }
  240. </script>
  241. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  242. <title>Untitled Document</title>
  243. </head>
  244.  


ciąg dalszy
  1. <body onLoad="sprc();">
  2. <?php
  3. $arrOfErrors;
  4. $arrOfColors;
  5. function CheckPESEL($str)
  6. {
  7. if (!preg_match('/^[0-9]{11}$/',$str))
  8. {
  9. return false;
  10. }
  11.  
  12. $arrSteps = array(1, 3, 7, 9, 1, 3, 7, 9, 1, 3);
  13. $intSum = 0;
  14. for ($i = 0; $i < 10; $i++)
  15. {
  16. $intSum += $arrSteps[$i] * $str[$i];
  17. }
  18. $int = 10 - $intSum % 10;
  19. $intControlNr = ($int == 10)?0:$int;
  20. if ($intControlNr == $str[10])
  21. {
  22. return TRUE;
  23. }
  24. return FALSE;
  25. }
  26.  
  27. function CheckDOWOD($str)
  28. {
  29. $str = strtoupper($str);
  30. $strarr;
  31. if (!preg_match('/^[0-9]{6}$/',substr($str, 3, 6)))
  32. {
  33. return false;}
  34. if (!preg_match('/^[A-Z]{3}$/',substr($str, 0, 3)))
  35. {
  36. return false;}
  37. for($i = 0; $i<10; $i++)
  38. {
  39. if($i < 3)
  40. $strarr[$i] = ord($str[$i]) - 55;
  41. else
  42. $strarr[$i] = $str[$i];
  43. }
  44. $arrSteps = array(7, 3, 1, 0, 7, 3, 1, 7, 3, 1);
  45. $intSum = 0;
  46. for ($i = 0; $i < 10; $i++)
  47. {
  48. $intSum += $arrSteps[$i] * $strarr[$i];
  49. }
  50. $int = $intSum % 10;
  51. $intControlNr = ($int == 10) ? 0 : $int;
  52. if ($intControlNr == $str[3])
  53. {
  54. return TRUE;
  55. }
  56. return FALSE;
  57. }
  58.  
  59. function validate($field, $type, $val = 0)
  60. {
  61. switch($type)
  62. {
  63. case 'min':
  64. if(strlen($_POST[$field]) >= $val)
  65. return TRUE;
  66. break;
  67. case 'tel':
  68. if(CheckTELEFON($_POST[$field]))
  69. return TRUE;
  70. break;
  71. case 'kod':
  72. if(CheckKOD($_POST[$field]))
  73. return TRUE;
  74. break;
  75. case 'pesel':
  76. if(CheckPESEL($_POST[$field]))
  77. return TRUE;
  78. break;
  79. case 'id':
  80. switch($val)
  81. {
  82. case '0':
  83. if(CheckDOWOD($_POST[$field]))
  84. return TRUE;
  85. break;
  86. }
  87. }
  88. return FALSE;
  89. }
  90. function CheckTELEFON($str)
  91. {
  92. if(!preg_match('/^[0-9]{9}$/',$str))
  93. return false;
  94. return true;
  95. }
  96. function CheckKOD($str)
  97. {
  98. if(!preg_match('/^[-0-9]{5,6}$/',$str))
  99. return false;
  100. return true;
  101. }
  102. if($_POST['spr'])
  103. {
  104. $valid = TRUE;
  105. if(!validate('pesel', 'pesel'))
  106. {
  107. $arrOfErrors['pesel_msg'] = 'Pesel może być błędny lub zbyt krótki';
  108. $valid = FALSE;
  109. $arrOfColors[0] = 1;
  110. }
  111. else
  112. $arrOfColors[0] = -1;
  113. if(!validate('imie', 'min', 3))
  114. {
  115. $arrOfErrors['imie_msg'] = 'Imie wymaga minimum 3 znaków';
  116. $valid = FALSE;
  117. $arrOfColors[1] = 1;
  118. }
  119. else
  120. $arrOfColors[1] = -1;
  121. if(!validate('nazwisko', 'min', 3))
  122. {
  123. $arrOfErrors['nazwisko_msg'] = 'Nazwisko wymaga minimum 3 znaków';
  124. $valid = FALSE;
  125. $arrOfColors[2] = 1;
  126. }
  127. else
  128. $arrOfColors[2] = -1;
  129. if(!validate('dokument_tozsamosci', 'id', $_POST['tozsamosc_typ']))
  130. {
  131. $arrOfErrors['tozsamosc_msg'] = 'Podany numer dowodu jest błędny';
  132. $valid = FALSE;
  133. $arrOfColors[3] = 1;
  134. }
  135. else
  136. $arrOfColors[3] = -1;
  137. if(!validate('imie_ojca', 'min', 3))
  138. {
  139. $arrOfErrors['imie_ojca_msg'] = 'Imie ojca wymaga minimum 3 znaków';
  140. $valid = FALSE;
  141. $arrOfColors[4] = 1;
  142. }
  143. else
  144. $arrOfColors[4] = -1;
  145. if(!validate('miejsce_urodzenia', 'min', 3))
  146. {
  147. $arrOfErrors['miejsce_urodzenia_msg'] = 'Miejsce urodzenia wymaga minimum 3 znaków';
  148. $valid = FALSE;
  149. $arrOfColors[5] = 1;
  150. }
  151. else
  152. $arrOfColors[5] = -1;
  153. if(!validate('ulica', 'min', 3))
  154. {
  155. $arrOfErrors['ulica_msg'] = 'Ulica wymaga minimum 3 znaków';
  156. $valid = FALSE;
  157. $arrOfColors[6] = 1;
  158. }
  159. else
  160. $arrOfColors[6] = -1;
  161. if(!validate('nr_lokalu', 'min', 1))
  162. {
  163. $arrOfErrors['nr_lokalu_msg'] = 'Numer lokalu wymaga minimum 1 znaku';
  164. $valid = FALSE;
  165. $arrOfColors[7] = 1;
  166. }
  167. else
  168. $arrOfColors[7] = -1;
  169. if(!validate('kod_pocztowy', 'kod'))
  170. {
  171. $arrOfErrors['kod_pocztowy_msg'] = 'Kod pocztowy nieprawidłowy';
  172. $valid = FALSE;
  173. $arrOfColors[8] = 1;
  174. }
  175. else
  176. $arrOfColors[8] = -1;
  177. if(!validate('miejscowosc', 'min', 3))
  178. {
  179. $arrOfErrors['miejscowosc_msg'] = 'Miejscowosc wymaga minimum 3 znaków';
  180. $valid = FALSE;
  181. $arrOfColors[9] = 1;
  182. }
  183. else
  184. $arrOfColors[9] = -1;
  185. /*if(!validate('telefon', 'tel'))
  186. {
  187. $arrOfErrors['telefon_msg'] = 'Podany numer jest nieprawidłowy. Pamiętaj o numerze kierunkowym';
  188. $valid = FALSE;
  189. }*/
  190. if($valid)
  191. {
  192. //Wysylanie maila
  193. }
  194. }


i końcówka...

  1. ?>
  2. <form id="formularz" class="formularz" action="form.php" method="post">
  3. <input type="checkbox" name="spr" id="spr" <?php if($_POST['spr']){echo 'checked=checked ';} ?>onClick="sprc();" style="position:relative;margin:0px auto;left:290px" ><span style="left:300px;position:relative;">
  4. Zapoznałem/-am się z regulaminem.</span>
  5. <div style="width:600px;position:relative;margin:0px auto;background:#F2F2F2;top:12px;">
  6. <span style="position:relative;display:block;top:0px;text-align:center;background:#0066FF;color:white;font-weight:bold;width:600px;height:22px;left:0px;">Wymagane dane</span>
  7. <table >
  8. <tr>
  9. <td align="right" width="150">
  10. <label>PESEL:</label>
  11. </td>
  12. <td align="center" width="150">
  13. <input style="width: 150px;font-size:12px;color:#555555;" maxlength="11" onblur="validate(0);" id="pesel" name="pesel" type="text" disabled="true" value="<?php echo $_POST['pesel'] ?>">
  14. </td>
  15. <td style="position:relative;left:5px;font-size:12px; color:#FF6600;" id="pesel_msg"><?php if($arrOfColors[0] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[0] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['pesel_msg'] ?></td>
  16. </tr>
  17. <tr>
  18. <td align="right" width="150">
  19. <label>Imię:</label>
  20. </td>
  21. <td align="center" width="150">
  22. <input style="width: 150px; font-size: 12px; color: #555555;" id="imie" onblur="validate(1);" name="imie" type="text" disabled="true" value="<?php echo $_POST['imie'];?>">
  23. </td>
  24. <td style="position:relative;left:5px;font-size:12px; color:#CC3300" id="imie_msg"><?php if($arrOfColors[1] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[1] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['imie_msg'] ?></td>
  25. </tr>
  26. <tr>
  27. <td align="right" width="150">
  28. <label>Nazwisko:</label>
  29. </td>
  30. <td align="center" width="150">
  31. <input style="width: 150px; font-size: 12px; color: #555555;" id="nazwisko" name="nazwisko" onblur="validate(2);" value="<?php echo $_POST['nazwisko'];?>" type="text" disabled="true">
  32. </td>
  33. <td style="position:relative;left:5px;font-size:12px; color:#CC3300" id="nazwisko_msg"><?php if($arrOfColors[2] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[2] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['nazwisko_msg'] ?></td>
  34. </tr>
  35. <tr>
  36. <td align="right" width="150">
  37. <label>Dokument tożsamości:</label>
  38. </td>
  39. <td align="center" width="150">
  40. <select style="width: 156px; font-size: 12px; color: #555555;" id="tozsamosc_typ" name="tozsamosc_typ" disabled="true">
  41. <option value="0">dowód osobisty</option>
  42. <option value="1">Prawo jazdy</option>
  43. <option value="2">Paszport</option>
  44. </select>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td align="right" width="150">
  49. <label>Seria i Numer:</label>
  50. </td>
  51. <td align="center" width="150">
  52. <input style="width: 150px; font-size: 12px; color: #555555;" id="dokument_tozsamosci" onblur="validate(3);" name="dokument_tozsamosci" type="text" disabled="true" value="<?php echo $_POST['dokument_tozsamosci'];?>" >
  53. </td>
  54. <td style="position:relative;left:5px;font-size:12px; color:#CC3300"><span id="tozsamosc_msg" style="width:120px;font-size:12px; color:#CC3300;position:relative;left:0px;"><?php if($arrOfColors[3] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[3] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['tozsamosc_msg'] ?></span></td>
  55. </tr>
  56. <tr>
  57. <td align="right" width="150">
  58. <label>Imię ojca:</label>
  59. </td>
  60. <td align="center" width="150">
  61. <input style="width: 150px; font-size: 12px; color: #555555;" id="imie_ojca" name="imie_ojca" onblur="validate(4);" type="text" disabled="true" value="<?php echo $_POST['imie_ojca'];?>">
  62. </td>
  63. <td style="position:relative;left:5px;font-size:12px; color:#CC3300" id="imie_ojca_msg"><?php if($arrOfColors[4] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[4] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['imie_ojca_msg'] ?></td>
  64. </tr>
  65. <tr>
  66. <td align="right" width="150">
  67. <label>Miejsce urodzenia:</label>
  68. </td>
  69. <td align="center" width="150">
  70. <input style="width: 150px; font-size: 12px; color: #555555;" id="miejsce_urodzenia" name="miejsce_urodzenia" onblur="validate(5);" type="text" disabled="true" value="<?php echo $_POST['miejsce_urodzenia'];?>">
  71. </td>
  72. <td style="position:relative;left:5px;font-size:12px; color:#CC3300" id="miejsce_urodzenia_msg"><?php if($arrOfColors[5] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[5] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['miejsce_urodzenia_msg'] ?></td>
  73. </tr>
  74. <tr>
  75. <td align="right" width="150">
  76. <label>Ulica:</label>
  77. </td>
  78. <td align="center" width="150">
  79. <input style="width: 150px; font-size: 12px; color: #555555;" id="ulica" name="ulica" onblur="validate(6);" type="text" disabled="true" value="<?php echo $_POST['ulica'];?>">
  80. </td>
  81. <td style="position:relative;left:5px;font-size:12px; color:#CC3300" id="ulica_msg"><?php if($arrOfColors[6] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[6] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['ulica_msg'] ?></td>
  82. </tr>
  83. <tr>
  84. <td align="right" width="150">
  85. <label>Nr domu/lokalu:</label>
  86. </td>
  87. <td align="center" width="150">
  88. <input style="width: 150px; font-size: 12px; color: #555555;" id="nr_lokalu" name="nr_lokalu" type="text" onblur="validate(7);" disabled="true" value="<?php echo $_POST['nr_lokalu'];?>">
  89. </td>
  90. <td style="position:relative;left:5px;font-size:12px; color:#CC3300" id="nr_lokalu_msg"><?php if($arrOfColors[7] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[7] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['nr_lokalu_msg'] ?></td>
  91. </tr>
  92. <tr>
  93. <td align="right" width="150">
  94. <label>Kod pocztowy: </label>
  95. </td>
  96. <td align="center" width="150">
  97. <input style="width: 150px; font-size: 12px; color: #555555;" id="kod_pocztowy" name="kod_pocztowy" type="text" onblur="validate(8);" disabled="true" value="<?php echo $_POST['kod_pocztowy'];?>">
  98. </td>
  99. <td style="position:relative;left:5px;font-size:12px; color:#CC3300"><span id="kod_pocztowy_msg" style="width:120px;font-size:12px; color:#CC3300;position:relative;left:0px;"><?php if($arrOfColors[8] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[8] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['kod_pocztowy_msg'] ?> (XX-XXX)</span></td>
  100. </tr>
  101. <tr>
  102. <td align="right" width="150">
  103. <label>Miejscowość: </label>
  104. </td>
  105. <td align="center" width="150">
  106. <input style="width: 150px; font-size: 12px; color: #555555;" id="miejscowosc" name="miejscowosc" onblur="validate(9);" type="text" disabled="true" value="<?php echo $_POST['miejscowosc'];?>">
  107. </td>
  108. <td style="position:relative;left:5px;font-size:12px; color:#CC3300" id="miejscowosc_msg"><?php if($arrOfColors[9] < 0)echo "<img src='img/tick.gif' />"; ?><?php if($arrOfColors[9] > 0) echo "<img src='img/cross.gif' /> "; ?><?php echo $arrOfErrors['miejscowosc_msg'] ?></td>
  109. </tr>
  110. <tr>
  111. <td>
  112. <input class="submit" type="submit" value="wyślij" style="position:relative;left:156px;top:-3px;width:150px;">
  113. </td>
  114. </tr>
  115. </table>
  116. </div>
  117. </form>
  118.  
  119. </body>
  120. </html>
Wykrywacz
Zamiast wrzucać tu wypociny, poczytaj o wyrażeniach regularnych, to pod kątem walidacje maila, oraz metodzie .lenght dla określenia długości w polach uwaga

http://www.marketingtechblog.com/javascrip...x-emailaddress/
http://nodejs.org/docs/v0.3.7/api/buffers.html
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.