Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/05/2005, 05:45
curl
 
Fecha de Ingreso: enero-2004
Ubicación: madrid
Mensajes: 121
Antigüedad: 20 años, 4 meses
Puntos: 0
comprobar radio button con Script

bueno pues mi problema es sencillo pero que no consigo hacerlo por mas que leo y mas pruebas que hago, la verdad es que en tema de script estoy algo perdido por no decir bastante. os pongo el codigo por si me podeis ayudar.
lo unico que quiero es que si no seleccionan ningun radiobutton en el formulario salte un alert. GRACIAS


<script language="JavaScript">
function id (form)
{
id = formBorrar.prueba.value;
if (id=='')
alert ('debes poner una noticia');
else
alert ('noticia valida');
}

</script>

<body>
<h3 align="center"><font color="#993333">
<%
Dim ConnTmp
Dim cmdGenTmp
Dim rsGenTmp
Dim addNoticia
Dim tipoAcc
Dim Ditem

Ditem = "hola"
Set ConnTmp = Server.CreateObject("ADODB.Connection")
ConnTmp.Open Application("Noticias")
Set cmdGenTmp = Server.CreateObject("ADODB.Command")
cmdGenTmp.CommandType = 1
Set cmdGenTmp.ActiveConnection = ConnTmp
Set rsGenTmp = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT * FROM NOTICIA ORDER BY id DESC"
rsGenTmp.Open SQL, connTmp, cursor


%>
BORRAR NOTICIA</FONT><br>
</h3>
<hr align="center" noshade>
<form action="" method="post" name="formBorrar" id="formborrar">
<p>
<!-- cogemos el ID de la noticia para pasarlo a borrarnoticia.asp-->
<input name="prueba" type="hidden" id="prueba"> </p>

<table align="center" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<!--DWLayoutTable-->
<tr>
<th>&nbsp;</th>
<th >Fecha</th>
<th >Noticia</th>
<% DO WHILE NOT rsGenTmp.Eof %>
<tr align="center">
<td >&nbsp;<input type="radio" name="radiobutton" value= <%= rsGenTmp ("ID")%> onClick="javascript:document.formBorrar.prueba.val ue=value">
&nbsp;</td>
<td>&nbsp;&nbsp; <%= rsGenTmp ("fecha") %>&nbsp;&nbsp; </td>
<td>&nbsp;&nbsp; <%= rsGenTmp ("noticia") %>&nbsp;&nbsp;</td>
</tr>
<%
rsGenTmp.Movenext
LOOP
%>
</table>

<p>
<input name="Validar" type="submit" value="Aceptar">
</form>
<!--#INCLUDE VIRTUAL="/IntranetGPS/includes/pie_de_pagina.asp" -->
</body>
</html>
__________________
@NDRES