Hi all, as per the subject, what I would like to do is to populate the name field of a custom form with the same value selected from a dropdown menu created with Studio:
Name:
DropDown: box_1, box_2, box3...
so, by choosing box_2 the name field will have the value box_2
I have on other occasions populated fields, but never with dropdown, so far I had done it this way:
In editviewdfs, in the field to be populated:
...
'customCode' => '<input type="text" value = "{$fields.n_box_c.value}" id = "name" name="name" readonly="readonly">',
...
the same thing is needed in the quickcreatedefs file.
In truth I was thinking of not using it, which is why I had posted the example in the editviewdefs, but now I am trying it with js as well:
I created a simple js, to see if it worked–the js works.
Now I’m trying to populate the name field, but I don’t know why, I’m having difficulty:
I think the problem is the “name” field, if instead of
$('#name').val(selection);
I use another custom field
$('#<custom_field>').val(selection);
the field is populated. Perhaps since the “name” field is an automatically created module’s own field, it has a special identification criterion or I cannot access its value to change it