What I want to do?
I want to display all categories in first drop down and in second all titles of related nodes with the selected category.
To get that I have mentioned all the tasks I have done. Please read below.
Created taxonomy named
category
with terms listedLaptop
,Car
,Mobile
etc.Content type named
product
with fieldstitle
,description
,category
etc. Thecategory
field uses term reference ofcategory
taxonomy.- Created a form with WebForm with fields named
category
andproduct
as drop down - First,
categories
drop down field, displayed all categories (Laptop, Car, Mobile) by using WebForm Term Options. - Second,
product
drop down field is empty yet.
I have used hook_form_FORM_ID_alter() hook to alter the webForm I created. I have found the solution to get all the nodes pragmatically those are related with specific taxonomy term ID.
My first question is how to display all these nodes' titles in existing drop down field?
Another question is on category
change, products
must be change according to its nodes like ajax?