Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>X-factor</title>
  6. </head>
  7.  
  8. <body>
  9. <script type="text/javascript">
  10. function funkcija(){
  11. var ime=document.getElementById("ime");
  12. var uime=document.getElementById("umetinickoIme");
  13. console.log(ime.value);
  14. if(!ime.value.match(/\S/) || !uime.value.match(/\S/)){
  15. alert("Сите полиња се задолжителни");
  16. }
  17. else{
  18. var pol=document.getElementsByName("pol");
  19. console.log(pol);
  20. if(pol[0].checked){
  21. pol="машко";
  22. }
  23. else if(pol[1].checked){
  24. pol="женско";
  25. }
  26. alert(ime.value + "\n" +pol +"\n" + document.getElementById("odberi").value + "\nУспешно се пријавивте");
  27. }
  28. }
  29. </script>
  30.  
  31. <h1>Форма за пријавување на X-Factor</h1>
  32. <table>
  33. <tr>
  34. <td>Име</td>
  35. <td ><input id="ime" type="text"></td>
  36. </tr>
  37. <tr>
  38. <td>Уметничко име</td>
  39. <td ><input id="umetinickoIme" type="text"></td>
  40. </tr>
  41. <tr>
  42. <td>Пол</td>
  43. <td>
  44. <input type="radio" name="pol" id="maski">Машки
  45. <input type="radio" name="pol" id="zenski">Женски
  46. </td>
  47. </tr>
  48. <tr>
  49. <td>Жанр: </td>
  50. <td>
  51. <select id="odberi">
  52. <option>Classical</option>
  53. <option>Pop</option>
  54. <option>Rock</option>
  55. </select>
  56. </td>
  57. </tr>
  58. </table>
  59.  
  60. <button type="button" onclick="funkcija()">Пријави се</button>
  61.  
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement