Changeset 9128

Show
Ignore:
Timestamp:
03/11/10 05:42:51 (2 years ago)
Author:
mbrevda
Message:

closes #4121; legacy warnInvalid should not require a filed to focus on. In an unorthodox move, patching libfreepbx as well so we dont have to wait for a lib to be published to take advantage of this. Will probobly be overwriten before the final relase anyway.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/common/libfreepbx.javascripts.js

    r8599 r9128  
    3838var whitespace=" \t\n\r";var decimalPointDelimiter=".";var defaultEmptyOK=false;function validateDestinations(theForm,numForms,bRequired){var valid=true;for(var formNum=0;formNum<numForms&&valid==true;formNum++){valid=validateSingleDestination(theForm,formNum,bRequired);} 
    3939return valid;} 
    40 function warnInvalid(theField,s){theField.focus();theField.select();alert(s);return false;} 
     40function warnInvalid(theField,s){if(theField){theField.focus();theField.select();}alert(s);return false;} 
    4141function isEmail(s){if(isEmpty(s)) 
    4242if(isEmail.arguments.length==1)return defaultEmptyOK;else return(isEmail.arguments[1]==true);if(isWhitespace(s))return false;var i=1;var sLength=s.length;while((i<sLength)&&(s.charAt(i)!="@")){i++;} 
  • freepbx/trunk/amp_conf/htdocs/admin/common/script.legacy.js

    r8391 r9128  
    181181// use this function on any <select> elements 
    182182function warnInvalid (theField, s) { 
    183     theField.focus(); 
    184     theField.select(); 
     183    if(theField){  
     184      theField.focus(); 
     185      theField.select(); 
     186    } 
    185187    alert(s); 
    186188    return false;