PageSourceSearch

https://www.nobelcom.com/js/common/input.js?1281

js nobelcom.com collected 2026-10-01 14:38:40 UTC 5,483 bytes, 187 lines download raw bytes

1<!--
2
3	function trim(stringToTrim) {
4		return stringToTrim.replace(/^\s+|\s+$/g,"");
5	}
6
7	function setInputValue(idInput, inputValue) {
8	    document.getElementById(idInput).value = inputValue;       
9	 }
10
11    function setInputValueAndSubmitForm(form, idInput, inputValue) {
12    	setInputValue(idInput, inputValue);       
13        form.submit();
14    }
15	
16    function clearInput(idInput) {
17		document.getElementById(idInput).value='';
18	}
19	
20	function setInputValueIfEmpty(idInput, value) {
21		if (document.getElementById(idInput).value=='')
22			document.getElementById(idInput).value=value;
23	}
24	
25	function setSelectedOption(selectId, optionValue) {
26		select = document.getElementById(selectId);
27		for ( i = 0; i < select.options.length; i++) {
28			if ( select.options[i].value == optionValue) {
29				select.options[i].selected = true;
30				return;
31			}
32		} 
33	}
34	
35	function confirmAction(confirmText) {
36		return confirm(confirmText);
37	}
38	
39	function confirmActionAndSubmitForm(form, confirmText) {
40		if (confirmAction(confirmText)) {
41			form.submit();
42		}
43	}
44    
45	function getPromptValue(idInput, dialogText) {
46		var response = prompt(dialogText, "");
47		if (response != null) {
48       		document.getElementById(idInput).value = response;
49       		return true;
50		}
51		return false;
52	}    
53
54	function getPromptValueWithDefault(idInput, dialogText, inputValue) {
55		var response = prompt(dialogText, inputValue);
56		if (response != null) {
57       		document.getElementById(idInput).value = response;
58       		return true;
59		}
60		return false;
61	}    
62		
63	function setSpanTextFromSelectOptionTitle(spanId, select, defaultMessage) {
64		if(!document.getElementById(spanId)) return;
65		
66		var selectOptionTitle=select.options[select.selectedIndex].title;
67		var spanMessage="";
68		if(selectOptionTitle) { spanMessage = selectOptionTitle; }
69						 else { spanMessage = defaultMessage; }
70		document.getElementById(spanId).innerHTML = spanMessage;
71	}
72
73	function setInputValueFromSelectOptionTitle(inputId, select) {
74		if(!document.getElementById(inputId)) return;
75		var selectOptionTitle=select.options[select.selectedIndex].title;
76		document.getElementById(inputId).value = selectOptionTitle;
77	}
78	
79	function setSpanTextFromSelectOptionAttribute(spanId, select, attributeName, defaultMessage) {
80		if(!document.getElementById(spanId)) return;
81		
82		var selectOption = eval('select.options[select.selectedIndex].' + attributeName);
83		var spanMessage = "";
84		if(selectOption) { spanMessage = selectOption; }
85				    else { spanMessage = defaultMessage; }
86		document.getElementById(spanId).innerHTML = spanMessage;
87	}
88	
89	
90	function focusAndSelectElement(elementId) {
91		element = document.getElementById(elementId);
92   		element.focus();
93		element.select();
94	}
95	
96	function focusAndSelectElementByName(elementName) {
97		element = document.getElementsByName(elementName)[0];
98		element.focus();
99		element.select();
100	}
101	
102	function syncronizeCheckboxes(masterCheckbox, destinationCheckboxesName) {
103
104		masterCheckboxChecked = masterCheckbox.checked;
105
106		var listDestinationCheckboxes = document.getElementsByName(destinationCheckboxesName);
107	    for(var i=0; i<listDestinationCheckboxes.length; i++)
108	    {
109	    	listDestinationCheckboxes[i].checked = masterCheckboxChecked;
110		}
111	}
112	
113	function setCheckboxesValue(checkBoxPrefixName, checkedValue){
114		var listDestinationControls = document.getElementsByTagName("input");
115	    for(var i=0; i<listDestinationControls.length; i++)
116	    {
117	    	if(listDestinationControls[i].type == "checkbox" && 
118	    	   listDestinationControls[i].name.indexOf(checkBoxPrefixName) != -1) {
119	    		listDestinationControls[i].checked = checkedValue;
120	    	}
121		}
122	}
123	
124	function deleteItemsFromSelect(selectId){
125		var select = document.getElementById(selectId);
126		var i;
127		for (i = select.length - 1; i>=0; i--) {
128		    if (select.options[i].selected) {
129		    	select.remove(i);
130		    }
131		}  
132	}   
133	
134	function copyCheckboxValue(checkBoxInputElementId, hiddenInputId){
135		checkBoxInputElement = document.getElementById(checkBoxInputElementId);
136		hiddenInputElement = document.getElementById(hiddenInputId);
137		if (checkBoxInputElement.checked != 1) {
138			hiddenInputElement.value='false'; 
139		} else {
140			hiddenInputElement.value='true';	
141		}
142	}
143	
144	function copyCheckboxValueEmpty(checkBoxInputElementId, hiddenInputId){
145		checkBoxInputElement = document.getElementById(checkBoxInputElementId);
146		hiddenInputElement = document.getElementById(hiddenInputId);
147		if (checkBoxInputElement.checked != 1) {
148			hiddenInputElement.value=''; 
149		} else {
150			hiddenInputElement.value='true';	
151		}
152	}
153	
154    function disableElement(element) {
155    	try {
156    		element.disabled = true;
157    	}catch(err){}
158  		if (element.childNodes && element.childNodes.length > 0) {
159    		for (var x = 0; x < element.childNodes.length; x++) {
160    			disableElement(element.childNodes[x]);
161    		}
162    	}
163    }
164
165    function enableElement(element) {
166    	try {
167    		element.disabled = false;
168    	}catch(err){}
169  		if (element.childNodes && element.childNodes.length > 0) {
170    		for (var x = 0; x < element.childNodes.length; x++) {
171    			enableElement(element.childNodes[x]);
172    		}
173    	}
174    }
175    
176    function jumpField(element, nextElementId) {
177    	//set focus to next element
178    	if ( element.value.length == element.maxLength) {
179        	var nextElement = document.getElementById(nextElementId);
180            if (nextElement != null) {
181            	nextElement.focus();
182            }
183        }
184    }
185        
186	
187// -->

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.