Salve,
vi espongo il mio problema, questo è il codice:
è un piccolo questionario, io vorrei sostituire "alert" con "document.write", in modo che mi compaia, al posto della finestrella, una scritta che dica se è giusto o sbagliato, e se è sbagliato un'opzione che mi faccia tornare indietro.codice:<html> <head> <script type="text/javascript"> function prova() { if (ubuntu.scelta[0].checked) { alert("Sbagliato"); } else if (ubuntu.scelta[1].checked) { alert("Sbagliato"); } else if (ubuntu.scelta[2].checked) { alert("Giusto"); } else if (ubuntu.scelta[3].checked) { alert("sbagliato"); } } </script> </head> <body> <form method="get" onSubmit="prova()" name="ubuntu"> <input type="radio" value="Ok" name="scelta" />Karmic Koala <input type="radio" value="Ok" name="scelta" />Natty Narwhal <input type="radio" value="Ok" name="scelta" />Oneiric Ocelot <input type="radio" value="Ok" name="scelta" />Warty Warthog <input type="submit" value="Verifica" /> </form> </body> </html>
Spero di esser stato chiaro e in un vostro aiuto per un utente alle prime armi con Javascript.
Grazie e buona serata

Rispondi quotando