PluginProbe
Property Hive / 1.4.5
Property Hive v1.4.5
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / assets / js / frontend / make-enquiry.js

make-enquiry.js in Property Hive 1.4.5, at assets/js/frontend/make-enquiry.js

55 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var is_submitting = false;
2 var form_obj;
3 jQuery( function($){
4
5 // Enquiry form being submitted
6 $('body').on('submit', 'form[name=\'ph_property_enquiry\']', function()
7 {
8 if (!is_submitting)
9 {
10 is_submitting = true;
11
12 var data = $(this).serialize() + '&'+$.param({ 'action': 'propertyhive_make_property_enquiry' });
13
14 form_obj = $(this);
15
16 form_obj.find('#enquirySuccess').hide();
17 form_obj.find('#enquiryValidation').hide();
18 form_obj.find('#enquiryError').hide();
19
20 $.post( propertyhive_make_property_enquiry_params.ajax_url, data, function(response) {
21
22 if (response.success == true)
23 {
24 if ( propertyhive_make_property_enquiry_params.redirect_url && propertyhive_make_property_enquiry_params.redirect_url != '' )
25 {
26 window.location.href = propertyhive_make_property_enquiry_params.redirect_url;
27 }
28 else
29 {
30 form_obj.find('#enquirySuccess').fadeIn();
31
32 form_obj.trigger("reset");
33 }
34 }
35 else
36 {
37 if (response.reason == 'validation')
38 {
39 form_obj.find('#enquiryValidation').fadeIn();
40 }
41 else if (response.reason == 'nosend')
42 {
43 form_obj.find('#enquiryError').fadeIn();
44 }
45 }
46
47 is_submitting = false;
48
49 });
50 }
51
52 return false;
53 });
54
55 });