Foros del Web » Programando para Internet » Javascript »

duda de como utilizar el javascript

Estas en el tema de duda de como utilizar el javascript en el foro de Javascript en Foros del Web. hola a todos es que tengo esto @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código HTML: Ver original <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns = ...
  #1 (permalink)  
Antiguo 01/09/2012, 13:52
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
duda de como utilizar el javascript

hola a todos es que tengo esto

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Documento sin t&iacute;tulo</title>
  5. var checkobj
  6.  
  7. function agreesubmit(el){
  8. checkobj=el
  9. if (document.all||document.getElementById){
  10. for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
  11. var tempobj=checkobj.form.elements[i]
  12. if(tempobj.type.toLowerCase()=="submit")
  13. tempobj.disabled=!checkobj.checked
  14. }
  15. }
  16. }
  17.  
  18. function defaultagree(el){
  19. if (!document.all&&!document.getElementById){
  20. if (window.checkobj&&checkobj.checked)
  21. return true
  22. else{
  23. alert("Please read/accept terms to submit form")
  24. return false
  25. }
  26. }
  27. }
  28.  
  29. </head>
  30.  
  31. <form name="form" onSubmit="return defaultagree(this)">
  32. Rest of your form here<br>
  33. <input name="check" type="checkbox" onClick="agreesubmit(this)"><b>I agree to the above terms</b><br>
  34. <input type="text" name="user" value="" size="25">
  35. <input type="text" name="pass" value="" size="25">
  36. <input type="Submit" value="Submit!" disabled>
  37. </form>
  38.  
  39. //change two names below to your form's names
  40. document.forms.form.check.checked=false
  41. document.forms.form.user.checked=false
  42. document.forms.form.pass.checked=false
  43. </body>
  44. </html>

y quiero poder usarlo que me funcione que si hay algun campo limpio no pueda utilizar el submit
  #2 (permalink)  
Antiguo 02/09/2012, 11:08
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
Respuesta: duda de como utilizar el javascript

nadie sabe como poder hacer esto

Etiquetas: funcion, html, input
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:30.