PageSourceSearch

https://ruralplus.it/js/functions.js

js ruralplus.it collected 2026-10-09 03:21:56 UTC 4,096 bytes, 320 lines download raw bytes

1function mostra(livello){
2
3	$('#'+livello).toggle();
4
5}
6
7<!-- stampa
8
9function printit() {
10
11        var NS = (navigator.appName == "Netscape");
12
13        var IE = (navigator.appName == "IE");
14
15        var VERSION = parseInt(navigator.appVersion);
16
17
18
19        if (VERSION > 3) {
20
21//              if (NS) {
22
23                if (window.print) {
24
25                    window.print() ;  
26
27                } else {
28
29                    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
30
31                        document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
32
33                        WebBrowser1.ExecWB(6, 2); //Use a 1 vs. a 2 for a prompting dialog box    
34
35                        WebBrowser1.outerHTML = "";  
36
37                }
38
39        }
40
41//        self.close();
42
43}
44
45//-->
46
47
48
49// PREVIENE SUBMIT AL FORM MULTIPLI
50
51var submitDone = false;
52
53
54
55function submitForm(myForm, button, action, target, msgOK) {   
56
57  if (!submitDone) {
58		if (!$(myForm)[0].checkValidity()) {
59			$(myForm)[0].reportValidity()
60			return false;
61		}
62		
63		submitDone = true;
64
65		button.disabled = true;
66
67
68
69		$('#loadingbtn').show();
70
71		
72
73		// legge le variabili del form
74
75		var inputs = []; 
76
77		$(':input', myForm).each(function() { 
78
79			if (this.type=="checkbox") { // se è una checkbox
80
81				if (this.checked==true) inputs.push(this.name + '=' + escape(this.value)); 
82
83			} 
84
85			else if (this.type=="radio") { // se è un radio button
86
87				if (this.checked==true) inputs.push(this.name + '=' + escape(this.value)); 
88
89			} 
90
91			else { // è un campo testo
92
93				inputs.push(this.name + '=' + escape(this.value)); 
94
95			} 
96
97		})
98
99		var parametri = inputs.join('&'); 
100
101		//alert("Parametri: "+parametri);
102
103		$.ajax(
104
105		{
106
107			type: "POST",
108
109			url: action,
110
111			data: parametri,
112
113			success: function(msg)
114
115			{
116
117				if (msg=='OK') {
118
119					$('#loadingbtn').hide();
120
121					$('#'+target).html('<p>'+msgOK+'</p>');
122
123					return true;
124
125				}
126
127				else {
128
129					$('#loadingbtn').hide();
130
131					alert(msg);
132
133					button.disabled = false;
134
135					submitDone = false;
136
137					return false;
138
139				}
140
141			},
142
143			error: function() {
144
145					$('#loadingbtn').hide();
146
147					alert("<? echo _erroregenerico; ?>");
148
149					return false;
150
151			}				
152
153		}
154
155		);
156
157  } else return false;
158
159}
160
161function seleziona(myForm, campo, action, target) {   
162
163		// se legge il codice o la descrizione
164
165		var codice = false;
166
167		// legge le variabili del form
168
169		var parametri = "p="+campo.value;
170
171		if (codice==true) parametri = parametri + "&c=1"; else parametri = parametri + "&c=0";
172
173		$.ajax(
174
175		{
176
177			type: "POST",
178
179			url: action,
180
181			data: parametri,
182
183			success: function(msg)
184
185			{
186
187					$('#'+target).html(msg);
188
189			},
190
191			error: function() {
192
193					alert("<? echo _erroregenerico; ?>");
194
195			}				
196
197		}
198
199		);
200
201}
202
203function checkifitaly(campo) {   
204
205$('#codiceregione').val('');
206
207$('#codiceprovincia').val('');
208
209$('#codicecomune').val('');
210
211$('#city').val('');
212
213if (campo.value!="IT") {
214
215		$('#regione').hide();
216
217		$('#provincia').hide();
218
219		$('#comune').hide();
220
221		$('#city').show();
222
223
224
225}
226
227else {
228
229		$('#regione').show();
230
231		$('#provincia').show();
232
233		$('#comune').show();
234
235		$('#city').hide();
236
237}
238
239}
240
241function azzera(target) {   
242
243$('#'+target).html('');
244
245}
246
247function show(target) {   
248
249$('#'+target).show();
250
251}
252
253function nascondi(target) {   
254
255$('#'+target).hide();
256
257}
258
259
260
261
262
263<!--comuni province regioni-->
264
265
266
267// Ottieni la base url
268
269url = document.location.href;
270
271xend = url.lastIndexOf("/") + 1;
272
273var base_url = url.substring(0, xend);
274
275
276
277function chiama_ajax(url,campo) {
278
279        
280
281		var parametri = "?p="+campo.value;
282
283		
284
285		//Inizia l'url con http?
286
287        if (url.substring(0, 4) != 'http') {
288
289                url = base_url + url;
290
291        }
292
293
294
295		url = url + parametri;
296
297		
298
299        // Crea un nuovo elemento JS
300
301        var jsel = document.createElement('SCRIPT');
302
303        jsel.type = 'text/javascript';
304
305        jsel.src = url;
306
307
308
309        //Appende l'elemento JS e quindi esegue la 'chiamata AJAX')
310
311        document.body.appendChild (jsel);
312
313}
314
315<!--comuni province regioni-->
316
317
318
319
320

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.