PageSourceSearch

https://trattorialacarabaccia.com/form.js

js trattorialacarabaccia.com collected 2026-10-04 09:11:31 UTC 5,247 bytes, 219 lines download raw bytes

1function checkCaptcha ()
2    {
3        
4
5		if (grecaptcha.getResponse() == ""){
6        
7            alert("SI PREGA DI COPLETARE LA VERIFICA");
8            return false;
9        }
10        else
11        
12            return true;
13        
14    }
15    
16    
17$(function()
18{
19//se serve
20	$('#modalres').on('show.bs.modal', function (event) {
21		
22		/*
23	  var button = $(event.relatedTarget) // Button that triggered the modal
24	  var recipient = button.data('whatever') // Extract info from data-* attributes
25	  // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
26	  // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
27	  var modal = $(this)
28	  modal.find('.modal-title').text('New message to ' + recipient)
29	  modal.find('.modal-body input').val(recipient)
30	  */ 
31	})
32
33
34
35	$('#modalres').on('hide.bs.modal', function (event) {
36		//quando nascondo verifico se devo cancellare i campi
37		if(window.errorccontatc == '0')
38		{
39			
40			$('#name').val('');
41			$('#email').val('');
42			$('#cellulare').val('');
43			$('#npersone').val('');
44			$('#date').val('');
45			$('#messaggio').val('');
46			 
47			$('#agree').prop('checked', false); 
48			$('#ora').val('');//deselect
49			//riporto la select delle ore al default
50			$('#ora	 option').prop('selected', function() {
51					return this.defaultSelected;
52				});
53			 
54			
55			}
56	 if(window.errorccontatc == '1')
57		{odal.find('.modal-title').text('New message to ' + recipient)
58			$('#testorisultato').html('Attenzione: ' +window.errorccontatmess );
59			var modal = $(this)
60			modal.find('.modal-title').text('ERRORE' )
61			 var modal = $(this)
62	  
63			modal.find('.modal-title').text('')
64	   
65			 
66			
67			}	
68			
69	  
70	})
71
72
73    function after_form_submitted(data) 
74    {
75		window.errorccontatc = data.errorcode;
76		window.errorccontatmess = data.error;
77        if(data.errorcode == '0')
78        {
79			$('#testorisultato').html('Gentile Cliente, grazie per averci contattato, risponderemo quanto prima.');
80			//tutto ok
81			$('#modalres').modal();
82			
83			//tutto ok success
84          
85        }
86        else
87        {
88			//se data.errorcode 1 errore di  validazione , 99 errrore di invio mail
89			if(data.errorcode == '1')
90			{
91				//alert('errore di validazione');
92				$('#testorisultato').html('Attenzione: ' +window.errorccontatmess ); 
93				$('#modalres').modal();
94			}
95			
96			if(data.errorcode == '99')
97			{
98				//alert('errore di invio mail');
99				$('#testorisultato').html('Attenzione: ' +window.errorccontatmess ); 
100				$('#modalres').modal(); 
101			}
102			 
103          
104            //reverse the response on the button
105            $('button[type="button"]', $form).each(function()
106            {
107                $btn = $(this);
108                label = $btn.prop('orig_label');
109                if(label)
110                {
111                    $btn.prop('type','submit' ); 
112                    $btn.text(label);
113                    $btn.prop('orig_label','');
114                }
115            });
116            
117        }//else
118    }
119    
120//	 ignore: ".ignore", con type="hidden"
121	// validate signup form on keyup and submit
122		$("#frmContact").validate({
123			 submitHandler: inviamail,
124		
125			rules: {
126				name: "required",
127			 
128				 
129				date: {
130					date: true ,
131					minlength: 5
132				 
133				},
134				email: {
135					required: true,
136					email: true
137				},
138				hiddenRecaptcha: {
139					required: function () {
140						if (grecaptcha.getResponse() == '') {
141							return true;
142						} else {
143							return false;
144						}
145					}
146				}, 
147				agree: "required"
148			},
149			messages: {
150				name: "Inserire un nome",
151				date: "Inserire una data valida",
152				 
153				 
154				email: "Inserire un indirizzo email valido",
155				hiddenRecaptcha: "Si prega di validare recaptcha",
156				agree: "Per continuare è necessario accettare la policy"
157		 
158			}
159		});
160
161//	$('#frmContact').submit(function(e)
162	function inviamail(e)
163      {
164		
165		  
166      //  e.preventDefault();
167		/*var rescaptcha =	checkCaptcha ();
168			if(rescaptcha)
169			*/
170				$form = $(this);
171				//show some response on the button
172				$('button[type="submit"]', $form).each(function()
173				{
174					$btn = $(this);
175					console.log($btn);
176					$btn.prop('type','button' ); 
177					$btn.prop('orig_label',$btn.text());
178					$btn.text('Sending ...');
179				});
180				
181			//	console.log($("#frmContact").serialize());
182				 $.ajax({
183						type: "POST",
184						url: 'process.php',
185						data: $("#frmContact").serialize(),
186						success: after_form_submitted,
187						dataType: 'json' 
188					});        
189				
190			 
191			
192			  }	
193			
194});
195
196
197 /* *******PARCHEGGIO********* */   
198 /* 
199		name = $('#name').val(); 
200		email = $('#email').val(); 
201		 */
202
203/* 
204 * 
205 *  $('form#reused_form').hide();
206            $('#success_message').show();
207            $('#error_message').hide();*
208            */ 
209//name=&email=&cellulare=&date=&ora=12%3A00&npersone=&messaggio=&token%5Bmailer%5D=2b0cca75ff5c3ed715f9e88fc9f64ee8&g-recaptcha-response=
210/*
211  $('#error_message').append('<ul></ul>');
212
213            jQuery.each(data.errors,function(key,val)
214            {
215                //$('#error_message ul').append('<li>'+key+':'+val+'</li>');
216            });
217            $('#success_message').hide();
218            $('#error_message').show();
219		*/

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.