Linked Questions

2 votes
1 answer

How to create dependent dropdown in drupal 7 content type? [duplicate]

I have created a 2 custome content type in drupal 7 one is tourname and another one is location. Once I added a tour name in tour content type like tour1,tour2 and so on. In location content type I ...
Rajivgandhi's user avatar
10 votes
5 answers

How to avoid "An illegal choice has been detected" when updating select list values via ajax?

I have four entity reference fields to user entity in a form. Host form is node edit form. Three of them are select lists, last is Inline Entity Form. After adding a user entity via IEF I'm trying ...
Codium's user avatar
  • 4,955
7 votes
3 answers

Resolve the error "An illegal choice has been detected..."

I have written code like below and all works fine, but while submitting the form I get the error below. I am trying to filter the second dropdown based on the first drop down selection. An illegal ...
Hacker's user avatar
  • 3,024
3 votes
1 answer

AJAX dependent select

I know this has been asked before and I'm trying to use the example at Dynamic select list in the form (dependent dropdown) but I am struggling to get the desired results. The goal: Have a form that ...
rsaturns's user avatar
  • 117
0 votes
3 answers

How to save custom fields when using hook_form_FORM_ID_alter?

I am implementing hook_form_FORM_ID_alter(). I have managed to setup for, and be able to collect custom values from the fields. When I submit the form, the node is created without my custom fields (i....
Waqas's user avatar
  • 53
5 votes
3 answers

How can I prepopulate a field when creating a new node with the values from a field collection?

I am creating an inventory management system in drupal. I have two different content types: and item and a purchase order. An item has a name, style code, Colors (this is a field collection with a ...
Keith's user avatar
  • 51
0 votes
2 answers

dependent dropdowns in ajax

Searching for cascading ajax dropdown in this forum only gives me two discussions here and the other here I have an almost similar issue only that the form select element I'm about to create ...
jan's user avatar
  • 865
2 votes
1 answer

Create dependent dropdown in views exposed filter

I've created a view of users. It includes two exposed filters as drop downs to filter the list. One is for the city and the other for the squadron. The squadron drop down is related to the cities as ...
Ben's user avatar
  • 1,030
2 votes
1 answer

form auto complete how to restrict results by previous drop down

Hi I have a select field on a form which contains countries. The next field is a text box which is driven by an autocomplete function. The autocomplete function returns cities from a database table. ...
PrestonDocks's user avatar
1 vote
2 answers

How can I create a field to hold data on users' countries and states?

I'm trying to create a content type that has multiple countries available to be selected and then multiple states/territories within those countries based on the country, but I'm not sure how to best ...
Rob Orr's user avatar
  • 399
0 votes
0 answers

AJAX dropdown lists dependent & dynamic

I have tried the example I found on Dynamic select list in the form API (dependent dropdown list)? but I did not get it to work properly. The first list populates, but I can not fill the second one ...
user19786's user avatar
0 votes
2 answers

How to get selected Value in the listbox by using form api

I have created a form with fields titled State and City. After selecting the state's appropriate city records, they will be loaded into city listbox. Until now they were working fine, but after ...
balakrishnan's user avatar
1 vote
1 answer

Ajax example dependent dropdown callback [duplicate]

I have two custom Drupal modules moduleA and moduleB. moduleA has all the functions for Ajax calls i.e. ajax_example_dependent_dropdown_callback and _ajax_example_get_second_dropdown_options. I ...
Arone Prem Kumar's user avatar
0 votes
1 answer

Adding Ajax on existing dropdown list

I added this code in my template.php function PORTO_SUB_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'rapporto_di_lavoro_node_form') { $form['field_livello']['und']['#...
Ponzio Pilato's user avatar
-1 votes
1 answer

States with a variable

I have to do a form and in this form I have a select to choose a value, from this value I load a node and from this node I get a boolean. With this boolean I have to show or not another form field, ...
Jess's user avatar
  • 5

15 30 50 per page