Timeline for How to add new form field dynamically on selected change using ajax
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 6, 2018 at 10:54 | comment | added | Stefan Korn | @4k4: awesome! Regret that I have only one upvote for this! | |
Jul 28, 2016 at 11:58 | vote | accept | Emad Kerhily | ||
Jul 28, 2016 at 11:57 | comment | added | Emad Kerhily | after debugging it seems the terms array is null and I resolve the problem | |
Jul 28, 2016 at 11:41 | comment | added | 4uk4 | It's hard to tell, why the select is empty. Did you examine what the controller function returns in $term? When you have more information, ask another question. | |
Jul 28, 2016 at 11:26 | comment | added | Emad Kerhily | oh thanks @4k4 it works perfectly, but I want some more help which is I want to fill in the level2 select with options. those options I retrieve from database in my controller function named getTermChild($termid) which return array of retrieved children what I did is: ` $val = $form_state->getValue('level1'); $terms = $controller->getTerms($val); $form['ajax_wrapper']['level2']['options'] = $terms; return $form['ajax_wrapper']; ` but still the select is empty | |
Jul 28, 2016 at 9:23 | comment | added | 4uk4 | see edited answer | |
Jul 28, 2016 at 9:22 | history | edited | 4uk4 | CC BY-SA 3.0 |
added 1015 characters in body
|
Jul 28, 2016 at 7:55 | comment | added | Emad Kerhily | please help me how to do what you suggest | |
Jul 28, 2016 at 7:20 | history | edited | 4uk4 | CC BY-SA 3.0 |
edited body
|
Jul 28, 2016 at 7:08 | history | answered | 4uk4 | CC BY-SA 3.0 |