How to add a value to a field via custom button I was wondering how do you add a value to a field on a form(node/add) via a custom button on views?

The scenario:
On the form(node/add) a user can see and search a list of venues(view block) and on each venue there is a 'more' when clicked the user will be able to see a pop-up of the details of that certain venue. Inside the popup there is the 'Select this venue' button when clicked should be able to add that certain venue to the field 'field_choose_venue'.

I've been trying this all day but no luck. Any help will be much appreciated.
The problem is complex. I think one way to address what you want is to code a JS behavior that is attachted to your block view that when user click each venue the venue value is added to the field and add more elements button is clciked, so Drupal reconstructs the form adding a new element.

Steps:


Add the venue nid to your View but hide it using CSS. This is a quick-and.dirty way to have the Venu nid available for your JS code. A better way is to alter the views output and add the nid in some other way.
Add a JS file for your module that will be added in that add form (use form alter and the $form['#attached'] key.
Your JS file should be a Drupal behavior JS that will attach a click listener to your venues elems in the block. When clicked, the listener will have to locate the last empty venue form field element, put clicked venue nid in that field elem and click the 'Add more' button of that multiple value field to trigger and AJAX call that will make Drupal to reconstruct the form and add a new empty value for the venue form element.


But the easy way is to use Entity Reference View Widget. The behavior is not exactly what you want but I think it can fit your needs.

This module allows to open a popup with a View where you can select the values of the field. As the popup is filled woth a View you have all the power if Views to modify what user sees in the view.