Guest User

Untitled

a guest
Dec 15th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. <HTML>
  2. <HEAD>
  3. <TITLE> QUI </TITLE>
  4. <script language="JavaScript">
  5. function controlla(modulo)
  6. {
  7. punteggio=0;
  8. if( modulo.IT.value =="IT")
  9. {punteggio++;
  10. else
  11. punteggio--;
  12. }
  13.  
  14. //gestione checkbox domanda 1
  15.  
  16. if(modulo.domanda1.value=="risp1" && modulo.domanda1.value=="risp4")
  17. {punteggio+=2;}
  18. else
  19. if(modulo.domanda1.value =="risp1" || modulo.domanda1.value=="risp4")
  20. {punteggio ++;}
  21. else
  22. if(modulo.domanda1.value !="risp1" && modulo.domanda1.value!="risp4")
  23. {punteggio--;}
  24. }
  25.  
  26.  
  27. //Gestione radio button
  28.  
  29. for(int i=0;i<2;i++)
  30. {if(modulo.jolly[i].value=="bella")
  31. punteggo+=10;
  32. }
  33.  
  34.  
  35. //gestione casella annodinascista
  36.  
  37. if(modulo.nascita.value=="94")
  38. punteggio++
  39. else
  40. if(modulo.nascita.value=="95")
  41. punteggio+=2;
  42. else
  43. if(modulo.nascita.value=="96")
  44. punteggio+=3;
  45. else
  46. if(modulo.nascita.value=="00")
  47. punteggio+=10;
  48.  
  49.  
  50. return false;
  51. alert("hai totalizzato:"+punteggio+"pt");
  52.  
  53. }
  54.  
  55. </script></head>
  56. <body>
  57. <form name=mod" onSubmit="return controlla(this);"
  58. action="aaa.php"
  59. method ="post">
  60. Abbrevia INFORMATION-TECHNOLOGY:<input type="text" name="IT" value="" size="02"> <br>
  61. Seleziona i riquadri esatti:<br>
  62. Sono hardware...
  63. <input type="checkbox" name= "domanda1" value="risp1"> mouse+tastiera <br>
  64. <input type="checkbox" name= "domanda1" value="risp2"> mouse+office <br>
  65. <input type="checkbox" name= "domanda1" value="risp3"> hard disk+monitor <br>
  66. <input type="checkbox" name= "domanda1" value="risp4"> casse+Outlook <br>
  67. Domanda bonus...<br>
  68. l'informatica è...<br>
  69. <input type="radio" name= "jolly" value="rad1">brutta
  70. <input type="radio" name= "jolly" value="rad2">bella
  71. <BR>
  72. Seleziona anno di nascita...
  73. <select multiple name="nascita">
  74. <option value="94" selected> 94 </option>
  75. <option value="95" > 95 </option>
  76. <option value="96" > 96 </option>
  77. <option value="00" > <96 </option>
  78. </Select>
  79. <br>
  80. <input type="reset" value="Cancella tutto ">
  81. <input type="submit" value="Invia test">
  82. <br>
  83. </form>
  84. </body>
  85. </html>
Add Comment
Please, Sign In to add comment