Can i set Calendar Date in repeater hidden field

Fredolino 17 Jun, 2019
Hello,
I wanted to ask if it is possible that I can automatically load the date entered into a calendar field (field_calendar3, Data25 [datum], ID: datum) into a hidden field in a repeater at the same time? And how are you?

Hidden field (field_hidden32)
Name: group [{var: area_repeater2.key}] [datum]
ID: date_ {var: area_repeater2.key}
value: {data: field_calendar3.datum}

F.
healyhatman 17 Jun, 2019
Sure don't see why not. Is it not working for you?
Fredolino 17 Jun, 2019
The way the settings are now is not. Do I have to set up an event in the Calendar field and trigger a javascript function ...
healyhatman 17 Jun, 2019
The "{data:field_calendar3.datum}" value would have to be available at the time the form loads so if that's not the case then yes you'd need a js function.
Fredolino 17 Jun, 2019
<script>
$("#datum").on("change", function(){
 $("#datum_1").val(parseInt($("#datum").val()));
});
</script> in load under Actions?
healyhatman 17 Jun, 2019
Replace $ with jQuery

Put it in a Custom Javascript under Views

Also....... It appears to only change the value of the #datum_1 field, which won't be much use? You probably want to have a 'starts with' or 'ends with' identifier and target the name of the repeater field.

Also also you can just add a function name as a field event for on change in the field settings. The name of the function goes in the right hand input not the left.
Fredolino 17 Jun, 2019
The problem is actually:

The user first enters the date and other data into a table1 in the form.
The date is also "still" stored in Table1.
The date data is stored in the table 2 via repeater area.
For later processing, it is better if the date is also stored in Table2.
But I do not want the user in the Repeater area constantly has to enter the same date.
Therefore I thought that it is easy to copy the date into a hidden field in the repeater via an event action in the calender field.

No idea if that's the way to go.
healyhatman 17 Jun, 2019
Why not use the date value as the "value" of the date field then?
Fredolino 17 Jun, 2019
calendar: field_calendar3 (black lable)
name: Fund[datum]
ID: datum

in the hidden field in repeater area:
name: group[{var:area_repeater2.key}][datum]
ID: datum_{var:area_repeater2.key}
Value: {var:field_calendar3.Fund.datum}
not working...
healyhatman 17 Jun, 2019
Well if you put {var:field_calendar3.Fund.datum} in a custom HTML block, does anything show? I bet you it doesn't. Have a look at your debug to see what data you've made available
Fredolino 17 Jun, 2019
Array
(
    [chronoform] => beobachtungen
    [event] => submit
    [Data25] => Array
        (
            [datum] => 2019-06-20
            [fundort] => Klosterfelde am Waldrand, BAR
        )

    [Data26] => Array
        (
            [beobachter] => Fred Ockruck
        )

    [Fund] => Array
        (
            [teilnehmer] => 
            [datenweitergabe] => 1
        )

    [group] => Array
        (
            [1] => Array
                (
                    [species] => lathonia, Issoria, (Linnaeus, 1758)
                    [anzahl] => 1
                    [stadium] => Imago
                    [geschlecht] => männl
                    [beobachtung] => Am Licht
                    [bestimmung] => Augenschein
                    [mapid_v] => 3
                    [datum] => 
                    [bemerkung] => 
                    [photo] => 
                )

        )
Fredolino 18 Jun, 2019
Answer
Ok, this works:

Calendar
Name: datum[datum]
Value: {var:datum[datum]}
ID: Datum

Under Action-Tab in Save Data:
Data overrides:
datum={var:save_data17.datum}=on insert

F.
This topic is locked and no more replies can be posted.