Comunidad de diseño web y desarrollo en internet online

varios scripts

Citar            
MensajeEscrito el 15 Feb 2006 10:39 pm
hola a todos, necesito saber como puedo porner varios scripts en la misma pagina es que tengo uno que es para poner un menu y otro para validar un formulario pero si pongo el del menu no me funciona el del formulario, este es el codigo de la pagina:

Código :

<html> 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel=stylesheet type="text/css" href="styles/style_blue.css">
<script language="javascript" src="include/javascript.js"></script>
<script language="javascript" src="./main_menu.js"></script>

<title>Welcome to Grant Thornton</title>


<style type="text/css">
<!--
body {
   margin-left: 0px;
   margin-top: 0px;
   margin-right: 0px;
   margin-bottom: 0px;
}
-->
</style>
<script>
function validar_noticia(){
   if(document.form1.titulo.value.length == 0){
      alert("Debe escribir un titulo");
      document.form1.titulo.focus();
      return 0;
   }
   document.form1.submit();
}
</script>
</head>

<body onLoad="PreloadImages(); ">
<?php 
$loged=$_GET['loged'];
if($loged != true)
{
   echo "<br><br><b>&nbsp;&nbsp;&nbsp;ERROR!</b> acceso restringido";
   die();
}
?>
<script>output_menu();</script><!--ESTE ES EL SCRIPT QUE DEBO QUITAR PARA QUE FUNCIONE LA FUNCION QUE TENGO EL EL HEAD LLAMADA validar_noticia()-->
<table width="772" height="97%" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="72" colspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="392" valign="top"><img src="images/logo.gif" width="388" height="72"></td>
    <td width="1"></td>
  </tr>
  <tr>
    <td width="194" rowspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="31" colspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td width="26" rowspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2" rowspan="3" valign="top"><form name="form1" method="post" action="guardarnoticia.php">
      <table width="95%" border="0">
        <tr>
          <td width="24%"><strong>Titulo de la Noticia</strong> </td>
          <td width="76%"><input name="titulo" type="text" id="titulo" size="52"></td>
        </tr>
        <tr>
          <td><strong>Noticia</strong></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2"><textarea name="noticia" cols="60" rows="10" id="noticia"></textarea></td>
          </tr>
         <tr>
        
          <td>&nbsp; <strong>Clasificaci&oacute;n</strong> </td>
          <td><select name="clasificacion" id="clasificacion">
            <option>Clasifique</option>
            <option value="1">Noticia</option>
            <option value="2">Articulo en ingles</option>
            <option value="3">Otro</option>
          </select>
          </td>
        </tr>
        <tr>
        
          <td><input name="accion" type="radio" value="0" checked>
            <strong>Terminar</strong>            &nbsp; </td>
          <td><input name="accion" type="radio" value="1">
            <strong>Insertar Otra</strong></td>
        </tr>
      <tr>
          <td>&nbsp; </td>
          <td><input name="enviar" type="button" id="enviar" value="Enviar" onclick="return validar_noticia()" />
            <input type="reset" name="Submit2" value="Restablecer" /></td>
      </tr>
      </table>
        </form>
    </td>
    <td height="32"></td>
  </tr>
  <tr>
    <td height="106" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="194" height="20" valign="top" class="callout_padding_head"><!--DWLayoutEmptyCell-->&nbsp;</td>
        </tr>
      <tr>
        <td height="86" valign="top" nowrap class="callout_padding"><!--DWLayoutEmptyCell-->&nbsp;</td>
        </tr>
      
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="97" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td></td>
  </tr>
  <tr>
    <td height="20" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="378" height="20" valign="middle" bgcolor="#0066cc"><span class="callout_white">&nbsp;&nbsp;&copy; 2006 Grant Thornton Colombia - Todos los derechos reservados</span></td>
          <td width="393" valign="middle" bgcolor="#0066cc"><div align="right"><span class="white"><A class=whitelink href="legal.htm">Legal</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A class=whitelink href="privacy.htm">Privacidad</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A class=whitelink href="sitemap.htm">Sitemap</A>&nbsp;&nbsp;</span></div></td>
        </tr>
      
      
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="2"></td>
    <td></td>
    <td width="159"></td>
    <td></td>
    <td></td>
  </tr>
</table>
</body>
</html>

como hago para que funcionen los 2?

Por chechopoker

91 de clabLevel



 

msie
Citar            
MensajeEscrito el 15 Feb 2006 11:56 pm
creo que nadie te va a responder este mensaje, pues es MUCHO código.
simplifícalo y a lo mejor alguien pueda echarle un mejor ojo

Por fael

BOFH

2443 de clabLevel

3 tutoriales
2 articulos

 

firefox
Citar            
MensajeEscrito el 16 Feb 2006 12:32 am
aca va simplificado:
en el head tengo:
una funcion que valida un formulario, y empezando el body va un script asi:

Código :

<body onLoad="PreloadImages(); ">
<script>output_menu();</script> //ESTE SCRIPT ES EL QUE NO DEJA FUNCIONAR AL SIGUIENTE!!!!!!!

luego sigue la pagina y tengo un formulario y el formulario tiene el siguiente input

Código :

<input name="enviar" type="button" id="enviar" value="Enviar" onclick"validar_noticia()" />

sin el script de arriba seguido del body me funciona la validacion pero si lo pongo ya no funciona, me sale error en la pagina
Gracias

Por chechopoker

91 de clabLevel



 

msie

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.