/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function verificarEntero(id,titulo){ var error=""; if($$(id)){ if(isNaN($$(id).value)){ error+=titulo+" debe ser un número.<br/>"; }else{ if($$(id).value<0){ error+=titulo+" debe ser un número positivo.<br/>"; } } } return error; }