text fields with events

How to configure ChronoForms text fields with events for location picker functionality.

Overview

The issue occurs when the field identifiers in the event settings do not match the actual field names or IDs.
Ensure the 'Elements identifier' uses the correct field names, listed on separate lines, and verify that the target fields exist in the form.

Answered
ChronoForms v6
Fr Fredolino 28 Mar, 2019
Answer
Hello,
I'm trying to create CF 6 text fields with events. But I probably do not do it right.
I oriented myself to the article in the FAQ "How to use the Fields Events".
In the text field with the ID "geloc3" I have in Extra attributes:
class: leaflet-locpicker
Under "Events":
on change
Action: Function
Elements identifier: #latitude AND #longitude

Then comes a Javascript:
$ ( '# Geoloc3'). LeafletLocationPicker ({
locationSep: '-'
})
.on ('show', function (e) {
$ (this) .siblings ('em'). text ('click on map for insert the location');
})
.on ('hide', function (e) {
$ (This) .siblings ('em') text ('.');
})
.on ('changeLocation', function (e) {
$ (This)
.siblings ('# geolat'). val (e.latlng.lat)
.siblings ('# geolng'). val (e.latlng.lng)
.siblings ('i') text ('"' + e.location + ''. ');
});

Then 2 text fields in which data should be displayed
Text field with ID "geolat"
Text field with ID "geolng"

It only appears to me in the text box with the class "leaflet-locpicker".

Wat is the problem....

Many Thanxs
F.
he healyhatman 28 Mar, 2019
You don't appear to actually have a field with the ID of latitude OR longitude. So that's not going to work.
Also it's a multiline line, so it would be
#latitude
#longitude
Also just use the NAME of the field, obviously without the #, not the ID.
This topic is locked and no more replies can be posted.