This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Field update when updating another field

Drupal 8.8.5

I have 2 fields data field_data and field_data_di_rientro
When I change the date of field_data, it must update the value of the field_data_of_entro field.

In form_alter I wrote this code
$ form ['field_data'] ['widget'] ['0'] ['value'] ['# attributes'] ['onchange'] = "this.form.data_di_rientro.value = this.value";

Since it does not update the second field, I inserted an alert on updating the field and it displays it
$ form ['field_data'] ['widget'] ['0'] ['value'] ['# attributes'] ['onchange'] = "alert ('OK')";
Where am I wrong?

Group multiple fields in table view?

I´m trying to group two fields in a table view but the following message appears : 

Competicion (one of the two fields): <!-- THEME DEBUG --> <!-- THEME HOOK: 'views_view_field' --> <!-- BEGIN OUTPUT from 'core/themes/stable/templates/views/views-view-field.html.twig' --> <a href="/node/443" hreflang="es">Trofeo Rectora</a> <!-- END OUTPUT from 'core/themes/stable/templates/views/views-view-field.html.twig' -->

and it doesnt works! Somebody know something about this?

Thanks all!

How can I fill some fields using the information of a uploaded image without submitting the form?

Hi all, 

I'm trying to fill some fields of my Media Type "Image" using the information obtained from the uploaded image. I explain what i did for now:

I have a Media Type "Image" with 4 fields:

- Title

- Description

- Image with Alt text

- Copyright

I create a new media "Image" and I upload a image. As soon as the image has been uploaded I want to fill Name, Description, Alt text and Copyright from the data of the image.

how to get the value of view reference field in form(field of module viewsreference)

I am altering the form of a custom block shown in layout builder and I need to get the value of views reference field to implement an ajax callback.i need the value of target_id. thanks for help

these two way return null

$form_state->getValue('viewsreference_field')
$form['viewsreference_field']['widget'][0]['target_id']['#value]

label and input field on the same line

Drupal 8.8.5
I have read various information on how to be able to view the label and then the input field when entering the variation (Form View Management)
Currently the form displays the date field in this manner.
Date
__ / __ / ____

I want to visualize it in this other way
Date __ / __ / ____
I have done various tests but I have not succeeded.
I saw that in View Manager you can choose the inline option for viewing.

Is it possible to insert?

Group fields by field of reference entity (View Module)

I´working with Views module. I`ve created a bootstrap table to group my contents and their fields, but I need to group the table by a field of the reference entity. I´dont know if I am explaining well. For example:

I have a content called Competition that has a field called academic year (number).

I have another content called Sport that has a field of entity reference to Competition.

I´ve created a table with:

Sports              Competition           Field        Another field             Options

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions