Form with javascript
-
- Posts: 2
- Joined: Sun Mar 26, 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)
any suggestions?
Chris D.
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);
}
Chris D.
-
- Posts: 2
- Joined: Sun Mar 26, 2017
SOLVED.
The Lat and Lon field had some gibberish internal names, not the Lat & Lon i was using
Chris D.
The Lat and Lon field had some gibberish internal names, not the Lat & Lon i was using
Chris D.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests