New Issue with Update
-
I have this set up on the main server and have a staging server that I do updates on first. Once I update this plugin the form no longer works and gives this error message in the DevTools in chrome.
/wp-admin/admin-ajax.php?action=cf7mls_validation 500 (Internal Server Error)
The only customization that’s being done is the autopopulate hidden fields from a google address search using jquery.<!-- jQuery for Miniform Validation, Progress Bar & CF7 Form Submission --> <script> jQuery(document).ready(function() { jQuery('.cf7mls_next').prop('disabled', true); jQuery('#longform input[type="submit"]').prop('disabled', true); jQuery('.cf7mls_next, #longform input[type="submit"]').css('background-color', '#dadada'); jQuery("button:disabled, #longform input[type='submit']").after("<div class='auto-alert'><p><i class='fa fa-exclamation-circle'></i> Please select a valid address using the autocomplete feature.</p></div>"); }); jQuery('#miniform, #longform').mousemove(function (){ if ((jQuery('#postal_code').val() > 0) && (jQuery('#postal_codeTO').val() > 0)){ jQuery('.cf7mls_next').prop('disabled', false); jQuery('#longform input[type="submit"]').prop('disabled', false); jQuery('.cf7mls_next, .wpcf7-submit').css('background-color', '#234e75'); jQuery('.auto-alert').hide(); } else { jQuery('.cf7mls_next').prop('disabled', true); jQuery('#longform input[type="submit"]').prop('disabled', true); jQuery('.cf7mls_next, .wpcf7-submit').css('background-color', '#dadada'); } }); jQuery('#miniform, #longform').on('touchstart', function (){ if ((jQuery('#postal_code').val() > 0) && (jQuery('#postal_codeTO').val() > 0)){ jQuery('.cf7mls_next').prop('disabled', false); jQuery('#longform input[type="submit"]').prop('disabled', false); jQuery('.cf7mls_next, .wpcf7-submit').css('background-color', '#234e75'); jQuery('.auto-alert').hide(); } else { jQuery('.cf7mls_next').prop('disabled', true); jQuery('#longform input[type="submit"]').prop('disabled', true); jQuery('.cf7mls_next, .wpcf7-submit').css('background-color', '#dadada'); } }); </script> <script> jQuery("button.cf7mls_next:eq(0)").click(function () { jQuery("#form-step-2").addClass("step-active"); jQuery("#form-step-1").removeClass("step-active"); }); jQuery("button.cf7mls_next:eq(1)").click(function () { jQuery("#form-step-3").addClass("step-active"); jQuery("#form-step-2").removeClass("step-active"); }); jQuery(".cf7mls_back").click(function () { if (jQuery("#form-step-2").hasClass("step-active")) { jQuery("#form-step-2").removeClass("step-active"); jQuery("#form-step-1").addClass("step-active"); } else if (jQuery("#form-step-3").hasClass("step-active")) { jQuery("#form-step-3").removeClass("step-active"); jQuery("#form-step-2").addClass("step-active"); } }); </script> <script> var placeSearch, autocomplete; var componentForm = { //street_number: 'short_name', //route: 'long_name', locality: 'long_name', administrative_area_level_1: 'short_name', //country: 'long_name' postal_code: 'short_name' }; function initAutocomplete() { // Create the autocomplete object, restricting the search to geographical // location types. autocomplete = new google.maps.places.Autocomplete( /** @type {!HTMLInputElement} */ (document.getElementById('autocomplete')), {types: ['geocode']}); // When the user selects an address from the dropdown, populate the address // fields in the form. autocomplete.addListener('place_changed', fillInAddress); autocomplete.setComponentRestrictions({'country': 'us'}); // Create the autocomplete object, restricting the search to geographical // location types. autocompleteTO = new google.maps.places.Autocomplete( /** @type {!HTMLInputElement} */ (document.getElementById('autocompleteTO')), {types: ['geocode']}); // When the user selects an address from the dropdown, populate the address // fields in the form. autocompleteTO.addListener('place_changed', fillInAddressTO); autocompleteTO.setComponentRestrictions({'country': 'us'}); } function fillInAddress() { // Get the place details from the autocomplete object. var place = autocomplete.getPlace(); for (var component in componentForm) { document.getElementById(component).value = ''; document.getElementById(component).disabled = false; } // Get each component of the address from the place details // and fill the corresponding field on the form. for (var i = 0; i < place.address_components.length; i++) { var addressType = place.address_components[i].types[0]; if (componentForm[addressType]) { var val = place.address_components[i][componentForm[addressType]]; document.getElementById(addressType).value = val; } } } function fillInAddressTO() { // Get the place details from the autocomplete object. var place = autocompleteTO.getPlace(); for (var component in componentForm) { document.getElementById(component + 'TO').value = ''; document.getElementById(component + 'TO').disabled = false; } // Get each component of the address from the place details // and fill the corresponding field on the form. for (var i = 0; i < place.address_components.length; i++) { var addressType = place.address_components[i].types[0]; if (componentForm[addressType]) { var val = place.address_components[i][componentForm[addressType]]; document.getElementById(addressType + 'TO').value = val; } } } // Bias the autocomplete object to the user's geographical location, // as supplied by the browser's 'navigator.geolocation' object. function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { var geolocation = { lat: position.coords.latitude, lng: position.coords.longitude }; var circle = new google.maps.Circle({center: geolocation, radius: position.coords.accuracy}); autocomplete.setBounds(circle.getBounds()); }); } } </script>
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘New Issue with Update’ is closed to new replies.