So I'm working on a list of departments, what I want todo is render the departments in a dropdown list, which once somebody selects that node I want it to take them to the page.
How can I achive this? I've got my departments renders out using a form in a dropdown box, but just need help with the next step.
<form id="email-form" name="email-form" data-name="Email Form" class="form">
<h2 class="heading-6">Search for Departments, Wards and Services</h2>
<label for="name">Name</label>
<input type="text" class="text-field w-input" maxlength="256" name="name" data-name="Name" placeholder="Type search keywords (e.g 'Outpatients')" id="name">
@******************** List Departments Start *******************@
<label for="email">Select department (optional)</label><select id="field-3" name="field-3" data-name="Field 3" class="text-field w-select">
<option value="">Select one...</option>
@{
var getDepartments = Umbraco.Content(Guid.Parse("2d0a41a3-9e4f-480a-bf79-741c67b72037"))
.Children()
.Where(x => x.IsVisible());
}
@foreach (var item in getDepartments)
{
<option value="">@item.Name</option>
}
</select>
@******************** List Departments End *******************@
</form>
Dropdown list of nodes
Hello,
So I'm working on a list of departments, what I want todo is render the departments in a dropdown list, which once somebody selects that node I want it to take them to the page.
How can I achive this? I've got my departments renders out using a form in a dropdown box, but just need help with the next step.
Thanks
Hi,
You need javascript. Something like:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.