You are viewing limited content. For full access, please sign in.

Question

Question

form not submitting because of javascript

asked on June 6, 2017 Show version history

hi guys,

Currently building a form with some google maps / image preview functionality but I've noticed when I include the google maps Javascript it doesn't save into the repository (but can be viewed / approved fine) 

Doesn't seem to be any errors in Javascript. 

Event Viewer has this error "The PDF generator was unable to contact the Laserfiche Forms server. Please ensure your SSL settings are correct. "

Any ideas?

getLocation();
  
  function getLocation() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(showPosition);
    } else {
      document.getElementById("q30").innerHTML = "Geolocation is not supported by this browser.";
    }
  }
  
  function showPosition(position) {
    $('#q31 input').val(position.coords.latitude + "|" + position.coords.longitude);
    drawMap($('#q31 input').val());
  }
  
  if ($('#q31').prop('tagName') != 'INPUT') {
    var divlatlong = document.getElementById("q31").innerHTML;
    drawMap(divlatlong);
  }
  
  function drawMap(n) {
    var position =  n.split('|');
    var latitude = position[0];
    var longitude = position[1];
    document.getElementById("q30").innerHTML = "<br />Latitude: " + latitude + "<br />Longitude: " + longitude;
   var google_tile = "http://maps.googleapis.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&zoom=16&size=400x150&markers=color:red|" + latitude + "," + longitude;
    var canvas = document.getElementById("map_canvas");
    var context = canvas.getContext("2d");
    var img = new Image();
    img.src = google_tile;
    img.onload = function(){
      context.drawImage(img, 0, 0);
     } 
  }

 

0 0

Answer

SELECTED ANSWER
replied on June 6, 2017 Show version history

To fix this issue I had to enable SSL in my forms configuration for the forms server. Why? I'm not sure, but that fixed it!

1 0

Replies

replied on June 6, 2017

I haven't done this yet in my forms.  Are you willing to share your form?

0 0
replied on June 6, 2017

I'll take out some of the customer specific stuff and leave in the google maps / image upload if you want to add it to your own form? 

I've not got the live image preview working but I can upload a google maps image to my form and images on the form itself.

0 0
replied on October 25, 2017

I'd still like to see this form...

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.