how to save data to a hidden extra field

how to save data to a hidden extra field

rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2

hi allan. in the editor I have three field to use

'''
fields: [ {
label: "name",
name: "name",
},
{
label: "last name ",
name: "last_nme",
},
{
label: "all name",
name: "all_name",
}, ]

I want to do is to fill only two fields "name" and " last_name " , and copy these 2 fields to the field " all_name " . But all_name field is not displayed .
As I can do this in the editor.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Sure - two options:

    1. Use ajax.data as a function to write the all_name value
    2. Use field().input() and apply a keyup change event listener to the name and last_name inputs that will then use field().val() to set the value of the all_name field.

    Allan

This discussion has been closed.