verificar Entero


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function verificarEntero(id,titulo){
  2. var error="";
  3. if($$(id)){
  4. if(isNaN($$(id).value)){
  5. error+=titulo+" debe ser un número.<br/>";
  6. }else{
  7. if($$(id).value<0){
  8. error+=titulo+" debe ser un número positivo.<br/>";
  9. }
  10. }
  11. }
  12. return error;
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.