Announcement

Collapse
No announcement yet.

Dynamic lookup fields for Dropdown field

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic lookup fields for Dropdown field

    If i have a field called "person_type" with drop down values "employee", "client", "vendor"
    I would need another drop down field, "lookup_table" (same form, same table) to pull different db tables based on selected "person_type"

    Person Type | List of "ID - Name"
    employee | "select ID || Name from employee_table
    client | "select ID || Name from client
    vendor | "select ID || Name from vendor

    how can i achieve this in SC?

  • #2
    Originally posted by weilies View Post
    If i have a field called "person_type" with drop down values "employee", "client", "vendor"
    I would need another drop down field, "lookup_table" (same form, same table) to pull different db tables based on selected "person_type"

    Person Type | List of "ID - Name"
    employee | "select ID || Name from employee_table
    client | "select ID || Name from client
    vendor | "select ID || Name from vendor

    how can i achieve this in SC?
    That's fairly simple. Go to your first dropdown field and scroll down the properties until you get the ajax events on change other select field. Just set the checkbox and select the field (your second pulldown) that needs to be refreshed.

    One tip: for the first select: set the use title to true and use title 'select...'. This is because the onchange event is not triggered on the default value so if you need to refresh the second field a change of the first is neccessary.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment

    Working...
    X