Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/04/2003, 13:04
Avatar de kaslierx
kaslierx
 
Fecha de Ingreso: febrero-2003
Ubicación: Valencia
Mensajes: 190
Antigüedad: 21 años, 9 meses
Puntos: 0
Funcion OnSubmit

Hola estoy usando este codigo para enviar un formulario:

Código:
<Script languague="JavaScript">
function votar(id) {
alert("El id es: " + id);
}
</Script>


<form name="survey" action="#" OnSubmit="votar(document.survey.respuesta.value)">
<table border="0" cellpadding="0" cellspacing="0" width="600">
  <tr>
    <td width="10" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="500" bgcolor="#91AAC1"><center><b><u>Pregunta</u></b></td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="10" bgcolor="#91AAC1"></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="600">
  <tr>
    <td width="10" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="20"  bgcolor="#DBE7F3"><center><input type="radio" name="respuesta" value="1"></td>
    <td width="5">&nbsp;</td>
    <td width="475"  bgcolor="#DBE7F3">&nbsp;&nbsp;·&nbsp;Opcion 1</td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="10" bgcolor="#91AAC1"></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="600">
  <tr>
    <td width="10" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="20"  bgcolor="#DBE7F3"><center><input type="radio" name="respuesta" value="2"></td>
    <td width="5">&nbsp;</td>
    <td width="475"  bgcolor="#DBE7F3">&nbsp;&nbsp;·&nbsp;Opcion 2</td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="10" bgcolor="#91AAC1"></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="600">
  <tr>
    <td width="10" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="20"  bgcolor="#DBE7F3"><center><input type="radio" name="respuesta" value="3"></td>
    <td width="5">&nbsp;</td>
    <td width="475"  bgcolor="#DBE7F3">&nbsp;&nbsp;·&nbsp;Opcion 3</td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="10" bgcolor="#91AAC1"></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="600">
  <tr>
    <td width="10" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="500" bgcolor="#91AAC1"><center><input type="submit" value="Votar"></td>
    <td width="5">&nbsp;</td>
    <td width="30" bgcolor="#91AAC1"></td>
    <td width="5">&nbsp;</td>
    <td width="10" bgcolor="#91AAC1"></td>
  </tr>
</table>
</form>
El proble esta en que al pulsar sobre votar el mensaje que me da es: El id es: undefined

Donde esta el fallo?