Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/01/2009, 09:15
flashtkd
 
Fecha de Ingreso: agosto-2008
Mensajes: 587
Antigüedad: 15 años, 10 meses
Puntos: 6
limpiar formularios, con javascript

Quiero hacer un limpiar formularios, estoy tratantado de tratar de hacerlo con javascript, miren esto que tal. que opinan de mi código malo, regular o bueno.



Código PHP:
<script type="text/javascript">

 if (
boton.name="submit" OK) { 

 
textfield1 ="";
 
textfield2 =""
 
checkbox1false;
 
checkbox2false;
 }
</script>


<form name="form1" method="post">
  <br>
  <p>Nombre: 
    <input type="text" name="textfield1">
  </p>
  <p>Comuna: 
    <input type="text" name="textfield2"> 
  </p>
  <p>
    <input type="checkbox" name="checkbox1" value="checkbox"> 
  Opcion 1 </p>
  <p>    <input type="checkbox" name="checkbox2" value="checkbox"> 
  Opcion 2</p>
  <p>
    <input type="submit" name="submit" value="Limpiar"> 
  </p>
</form>