Form: Field B values depends on selected value Field A

bert limerkens asked on November 10, 2016 08:41

Hey guys,

I have created a custom module with classes brand & products. Each brand has different products. Now I wanted to use these in my form.

when I use the Field element in my form layout everything works fine.

<div class="row">
  <div class="col-md-5">
    <cms:FormField runat="server" ID="fBrand" Field="Brand" />
  </div>
</div>
<div class="row">
  <div class="col-md-5">
    <cms:FormField runat="server" ID="fType" Field="Type" />
  </div>
</div>

When I use the Label & Input element the dropdown of my products doesn't get filled.

<div class="row">
  <div class="col-md-5">
    <cms:FormLabel runat="server" ID="lBrand" Field="Brand" /><cms:FormControl runat="server" ID="iBrand" Field="Brand" FormControlName="DropDownListControl" CssClass="" />
  </div>
</div>
<div class="row">
  <div class="col-md-5">
    <cms:FormLabel runat="server" ID="lType" Field="Type" /><cms:FormControl runat="server" ID="iType" Field="Type" FormControlName="DropDownListControl" CssClass="" />
  </div>
</div>

my sql looks like this:

SELECT
  HearingImplantID as 'value', HearingImplantName as 'name'
FROM
  VDProducts_HearingImplant
WHERE
  BrandID = '{% Brand %}'

For styling reasons I must use the label & input fields.

Am I doing something wrong? Do I have to change my query when using Input element?

   Please, sign in to be able to submit a new answer.