Alguna sugerencia, puse el evento en el boton, al hacer click, tbn puse el evento en el formulario al enviar, ahora, no se me ocurre nada mas... pues tbn puse en vez de return true, puse;: document.formu.submit(), y me sale acceso denegado.
Gracias, y espero sus coemntarios.
les dejo mi script.
Código HTML:
<? session_name("Sistema"); session_start(); import_request_variables("GP"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Documento sin título</title> <script type="text/javascript"> function verifica() { if(document.formu.encabezado.value=='') { alert('Ingrese campo'); document.formu.encabezado.focus(); return false; } if(document.formu.categoria.value=='0') { alert('Seleccione opcion'); document.formu.categoria.focus(); return false; } if(document.formu.descripcion.value=='') { alert('Ingrese campo'); document.formu.descripcion.focus(); return false; } if(document.formu.arriba.value=='') { alert('Ingrese campo'); document.formu.arriba.focus(); return false; } if(document.formu.derecha.value=='') { alert('Ingrese campo'); document.formu.derecha.focus(); return false; } if(document.formu.izquierda.value=='') { alert('Ingrese campo'); document.formu.izquierda.focus(); return false; } if(document.formu.abajo.value=='') { alert('Ingrese campo'); document.formu.abajo.focus(); return false; } return true; } </script> <style type="text/css"> <!-- body { background-color: #FFFFFF; } .boton{ width:100px; } .Estilo3 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } .Estilo4 {font-weight: bold} --> </style></head> <body> <form method="post" enctype="multipart/form-data" name="formu" id="formu" action="registra.php" > <table width="746" height="474" border="0" align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:12px"> <tr> <td height="26" colspan="2" align="center" valign="top">INFORMACIÓN GENERAL </td> </tr> <tr> <td height="18" valign="top"> </td> <td valign="top"> </td> </tr> <tr> <td width="101" height="37" valign="top">ENCABEZADO:</td> <td width="635" valign="top"><label> <textarea name="encabezado" cols="80" rows="2" id="encabezado"></textarea> </label></td> </tr> <tr> <td height="47" valign="top">CATEGORÍA:</td> <td valign="top"><label> <select name="categoria" id="categoria"> <option value="0">---SELECCIONE--</option> <option value="1">DAMAS</option> <option value="2">NIÑOS</option> <option value="3">CABALLEROS</option> </select> </label></td> </tr> <tr> <td height="78" valign="top">DESCRIPCIÓN:</td> <td valign="top"><textarea name="descripcion" cols="80" rows="4" id="descripcion"></textarea></td> </tr> <tr> <td height="27" colspan="2" align="center" valign="top">VISTAS</td> </tr> <tr> <td height="17" valign="top"> </td> <td valign="top"> </td> </tr> <tr> <td height="44" valign="top"> ARRIBA: </td> <td valign="top"><label> <input name="arriba" type="file" id="arriba" /> </label></td> </tr> <tr> <td height="45" valign="top"> DERECHA: </td> <td valign="top"><label> <input name="derecha" type="file" id="derecha" /> </label></td> </tr> <tr> <td height="39" valign="top"> IZQUIERDA </td> <td valign="top"><label> <input name="izquierda" type="file" id="izquierda" /> </label></td> </tr> <tr> <td height="40" valign="top">ABAJO </td> <td valign="top"><label> <input name="abajo" type="file" id="abajo" /> </label></td> </tr> <tr> <td height="30" colspan="2" align="center"><label> <input name="envia" type="submit" id="envia" value="REGISTRAR" onclick="javascript: return verifica();" /> <input name="limpia" type="reset" id="limpia" value="LIMPIAR" /> </label></td> </tr> </table> <br /> </form> </body> </html>