Funciones errorOutputPre y errorOutput


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

Establece la variable de validación en false y genera el mensaje de error de validación en función de los parámetros introducidos.
Recibe el elemento y los parámetros de validación.


Copy this code and paste it in your HTML
  1. function errorOutputPre(element_form){
  2. errorOutput(element_form,msgType,msgLanguage,msgXmlDoc,errMsgCat);
  3. }
  4.  
  5. function errorOutput(element_form,msgType,msgLanguage,msgXmlDoc,errMsgCat){
  6. todoOk=false;
  7. switch(msgType){
  8. case 'alert':alert(loadXmlReports(errMsgCat,msgLanguage,msgXmlDoc));
  9. element_form.onkeypress= function(){
  10. this.style.backgroundColor='#FFFFFF';
  11. }
  12. break;
  13.  
  14. case 'id' : document.getElementById('errMsg').innerHTML=loadXmlReports(errMsgCat,msgLanguage,msgXmlDoc);
  15. element_form.onkeypress= function(){
  16. this.style.backgroundColor='#FFFFFF';
  17. document.getElementById('errMsg').innerHTML='';
  18. }
  19. break;
  20.  
  21. case 'sibling' : element_form.nextSibling.innerHTML=loadXmlReports(errMsgCat,msgLanguage,msgXmlDoc);
  22. element_form.onkeypress= function(){
  23. this.style.backgroundColor='#FFFFFF';
  24. this.nextSibling.innerHTML='';
  25. }
  26. break;
  27. }
  28. element_form.style.backgroundColor='#FFFF99';
  29. element_form.focus();
  30. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.