Ayuda con formulario basico

davicin
10 de Abril del 2003
Hola. Estoy haciendo un formulario basico, y cuando le hago el submit, me abre el jsp al que le mando. Si alguien me pude decir pq es se lo a gradecería. COpio el codigo por si no me he explicado muy bien.

<html>
<head>
<title>Mantenimiento de Becas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
(document.all)? document.write('<link rel="stylesheet" href="../estilos/estilos.css" type="text/css">') : document.write('<link rel="stylesheet" href="../estilos/estilos_nt.css" type="text/css">');
</script>
<script>
function guardar()
{
if (validar())
{
alert("dentro de guardar.validar");
document.forms.nuevo_tipo.nombre_tipo.focus();
//document.forms.nuevo_tipo.action = "fn_tipos.jsp";
document.forms.nuevo_tipo.submit();
}
}//fin de guardar
function validar()
{
var res = true;
if (document.forms.nuevo_tipo.nombre_tipo.value == "")
{
res = false;
alert("Debe completar el nombre del Tipo");
document.forms.nuevo_tipo.nombre_tipo.focus();
}
else
{
if ((!document.forms.nuevo_tipo.Tipo_Visible[0].checked) &&
(!document.forms.nuevo_tipo.Tipo_Visible[1].checked))
{
alert("Debe seleccionar si está o no visible el Tipo");
res = false;
}
}
return (res);
}
function inicia()
{
document.forms[0].nombre_tipo.focus();
document.forms[0].nombre_tipo.select();
document.forms[0].Tipo_Visible[0].checked = true;
}
</script>
</head>
<body bgcolor="#ffffff" onload="javascript:inicia()">
<form method="post" name="nuevo_tipo" action="mantenimientoBanners.jsp">
<input type="hidden" name="accion" value="ins">
<table width=100% height="319" border=0 align="center" cellpadding=0 cellspacing=0>

<td width="11%"></td>
<tr>
<td height="30" colspan="12">&nbsp;</td>
</tr>
<tr>
<td height="33" valign="bottom" colspan="10">&nbsp;<img src="../images/azul2.gif" width="6" height="6">&nbsp;NUEVO
TIPO</td>
</tr>
<tr>
<td bgcolor="#FF9001" height="1" colspan="12"><img src="images/trans.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="65" colspan="12">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;Nombre de tipo:</td>
<td colspan="4">&nbsp; <input type="text" name="nombre_tipo" size="50"></td>
<td width="7%">&nbsp;&nbsp;</td>
</tr>
<tr>
<td height="3" colspan="12">&nbsp;</td>
</tr>
<tr>
<td height="76" colspan="3">&nbsp;¿Tipo Visible?:</td>
<td colspan="4"> <input type="radio" name="Tipo_Visible" value="0">
S&iacute;<br> <input type="radio" name="Tipo_Visible" value="1">
No</td>
<td rowspan="2">&nbsp;&nbsp;</td>
</tr>
<tr>
<td height="20" colspan="3">&nbsp;</td>
<td colspan="4">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp; </td>
<td width="25%">&nbsp;</td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="center">
<a href="javascript:Guardar();">
<img src="../../images/admin/botonGuardar.jpg" border="0">
</a>
</td>
<td align="center">
<a href="inicio_banners.jsp">
<img src="../../images/admin/botonCancelar.jpg" border="0">
</a>
</td>
</tr>
</table>
<td width="10%"><input name="bGuardarTipo" type="button" onClick="guardar();" value="Guardar Tipo"></td>
<td width="38%">&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>