Diferència entre revisions de la pàgina «Solució valor quadre text»

De wikiserver
Dreceres ràpides: navegació, cerca
(Es crea la pàgina amb «valor = document.getElementById("campo").value; if( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) { return false; }».)
 
 
Línia 1: Línia 1:
 +
<source type="java">
 
valor = document.getElementById("campo").value;
 
valor = document.getElementById("campo").value;
 
if( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
 
if( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
 
   return false;
 
   return false;
 
}
 
}
 +
 +
</source>

Revisió de 15:43, 18 gen 2015

valor = document.getElementById("campo").value;
if( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
  return false;
}