este es mi codigo;
El custionario imprime todo las preguntas que haya en la base de datos segun el tema, sale el listado de preguntas, todas las preguntas tienes 3 respuestas con su correspondiente radio button, el script en cuestión realizaría la corrección de la pregunta, siendo que al clickar sobre el radio button apareciera el comentario de la respuesta. Tambien otra posibilidad seria hacerlas todas y al final como veis hay un boton de corregir, que al clikear ejecutara el script para todas las respuestas y sus correspondientes comentarios. Como veis lo he pensado de dos formas diferentes y he intentado hacer una función que se llame Valida(), pero sin exito.
Cita: <html>
<head>
<title>Documento sin título</title>
<script language="javascript">
function Valida()
{
}
</script>
</head>
<body>
<form name="correct" onClick="Valida()">
<table width="643" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" align="left" valign="top"><font size="2" face="Trebuchet MS">1 . </font><font size="2" face="Trebuchet MS">Determine which past allomorph would be adequate for the verb DECIDE</font></td>
</tr>
<tr>
<td width="492"><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad1" type="radio" value="You’re right!">
</label></font><font size="2" face="Trebuchet MS">/Id/
<script>
document.write ("You’re right!");
</script>
</font></td>
<td width="144" colspan="2" rowspan="3"></textarea></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad1" type="radio" value="Sorry! Your response is incorrect. Please try again" >
</label>
/d/
<script>
write("Sorry! Your response is incorrect. Please try again");
</script>
</font></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label>
<input name="rad1" type="radio" value="Sorry! Your response is incorrect. Please try again"></label>
/t/ write("Sorry! Your response is incorrect. Please try again");
</font></td>
</tr>
<tr>
<td colspan="3"><hr align="center"></td>
</tr>
</table>
<table width="643" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" align="left" valign="top"><font size="2" face="Trebuchet MS">2 . </font><font size="2" face="Trebuchet MS">Examine the final –ER in the word COLDER</font></td>
</tr>
<tr>
<td width="492"><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad2" type="radio" value="You’re right!">
</label></font><font size="2" face="Trebuchet MS">It is an inflectional suffix.
<script>
document.write ("You’re right!");
</script>
</font></td>
<td width="144" colspan="2" rowspan="3"></textarea></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad2" type="radio" value="Sorry! Your response is incorrect. Please try again" >
</label>
It is not a morpheme
<script>
write("Sorry! Your response is incorrect. Please try again");
</script>
</font></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label>
<input name="rad2" type="radio" value="Sorry! Your response is incorrect. Please try again"></label>
It is a derivative suffix write("Sorry! Your response is incorrect. Please try again");
</font></td>
</tr>
<tr>
<td colspan="3"><hr align="center"></td>
</tr>
</table>
<table width="643" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" align="left" valign="top"><font size="2" face="Trebuchet MS">3 . </font><font size="2" face="Trebuchet MS">Analyse the word UNFORTUNATELY into morphs.</font></td>
</tr>
<tr>
<td width="492"><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad3" type="radio" value="You’re right!">
</label></font><font size="2" face="Trebuchet MS">UN (prefix) + FORTUNE (root) + ATE (suffix) + LY (suffix)
<script>
document.write ("You’re right!");
</script>
</font></td>
<td width="144" colspan="2" rowspan="3"></textarea></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad3" type="radio" value="Sorry! Your response is incorrect. Please try again" >
</label>
UN (prefix) + FORTUNE (root) + ATELY (suffix)
<script>
write("Sorry! Your response is incorrect. Please try again");
</script>
</font></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label>
<input name="rad3" type="radio" value="Sorry! Your response is incorrect. Please try again"></label>
UN (prefix) + FORTUNATE (root) + LY (prefix) write("Sorry! Your response is incorrect. Please try again");
</font></td>
</tr>
<tr>
<td colspan="3"><hr align="center"></td>
</tr>
</table>
<table width="643" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" align="left" valign="top"><font size="2" face="Trebuchet MS">4 . </font><font size="2" face="Trebuchet MS">Examine the final –ER in the word RIDER</font></td>
</tr>
<tr>
<td width="492"><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad4" type="radio" value="You’re right!">
</label></font><font size="2" face="Trebuchet MS">It is a derivative suffix
<script>
document.write ("You’re right!");
</script>
</font></td>
<td width="144" colspan="2" rowspan="3"></textarea></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label></label>
<label>
<input name="rad4" type="radio" value="Sorry! Your response is incorrect. Please try again" >
</label>
It is not a morpheme
<script>
write("Sorry! Your response is incorrect. Please try again");
</script>
</font></td>
</tr>
<tr>
<td><font size="2" face="Trebuchet MS">
<label>
<input name="rad4" type="radio" value="Sorry! Your response is incorrect. Please try again"></label>
It is an inflectional suffix. write("Sorry! Your response is incorrect. Please try again");
</font></td>
</tr>
<tr>
<td colspan="3"><hr align="center"></td>
</tr>
</table>
<table width="66" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><input name="leer" type="button" value="Corregir" onClick="Valida()"></td>
</tr>
</table>MORPHOLOGY</form>
</body>
</html>