Lawrence Nwezza
Lawrence Nwezza

Reputation: 1

Implementing logical nested select in quickForm SimpleSchema

Property.attachSchema(new SimpleSchema({
  'LGA': {
    label: "L.G.A",
    type: String,
    allowedValues:
    ["Aba","Oha", "Enu"],
    autoform: {
        afFieldInput: {
          firstOption: "(Pls, Select the L.G.A)"
        }
    }
  }
,
'Town': {
  label: "Town",
  type: String,
  allowedValues:
  ["Abakpa","Ewula", "Ezeoka", "Ubu","Echa", "Onu" ,"Eke", "Afor"],
  autoform: {
    afFieldInput: {
      firstOption: "(Pls, Select the Ward)"
    }
    }
  }

});

I have the schema above and I am using quickForm to implement this schema. "Abakpa","Ewula", "Ezeoka" are towns in "Aba" LGA while "Ubu","Echa", "Onu" are towns in "Oha" LGA and "Eke", "Afor" belong to "Enu" LGA. This is just for illustration because the list is quite numerous. I want a situation where if "Aba" is selected, the option that will be available for the Town select field would be "Abakpa","Ewula", "Ezeoka". If Oha is selected then "Ubu","Echa", "Onu" will be the next option in the Town schema etc. Pls, how do I implement this?.Thanks.

Upvotes: 0

Views: 43

Answers (0)

Related Questions