Form with javascript

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Kabelsatan
Posts: 2
Joined: Sun Mar 26, 2017

26 Mar 2017

Hi

Im new to spform and sharepoint in general. I need some help with javascript.

I have a form with 3 fields, Url, Lat & Lon. My goal is to populate the Lat and Lon fields in an onChange event on the Url field.

Ive made this script, and added it in spform, but it doent seem to run

Testurl:
https://www.google.no/maps/place/Karmøy ... d5.2896453

I have tested the function outside of Sharepoint environment, and it runs and does what it should, in this example parse the url
and get the Lat, and Lon koordinates (59.2924316,5.2874566)

Code: Select all

var mySplitResult;
var mySplitSubResult;
var mylat;
var mylon;

fd.field(‘Url’).change(GetGeoLoc());

function(GetGeoLoc){
	var myString = fd.field(‘Url’).value();
	mySplitResult = myString.split("@");
	mySplitSubResult = mySplitResult[1].split(",");

	mylat = mySplitSubResult[0]);
	fd.field(‘Lat’).value(mylat);

	mylon = mySplitSubResult[1]);
	fd.field(‘Lon’).vakue(mylon);
 }  
any suggestions?

Chris D.

Kabelsatan
Posts: 2
Joined: Sun Mar 26, 2017

26 Mar 2017

SOLVED.

The Lat and Lon field had some gibberish internal names, not the Lat & Lon i was using

Chris D.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests