Selectize with additional ontions

Selectize with additional ontions

dmryzhkovdmryzhkov Posts: 8Questions: 3Answers: 0
edited March 2017 in Free community support

Hello! Thank you for quick and quality answers to all my questions!
There was one more question: there are 2 tables, for example, "users" and "users_addresses", one to many. In some form, I have an Editor with 2 selectize fields.
If I use selectize in the "user_address" field, I get all the values of the "users_addresses" table in the dropdown. Can I add an additional option to the query (for example, "user_id") to dropdown the list from current row field? Can I clear the "user_address" field when "user" is changed? Thanks!

Answers

  • allanallan Posts: 63,871Questions: 1Answers: 10,525 Site admin

    Can I add an additional option to the query (for example, "user_id") to dropdown the list from current row field?

    I think you'd really need to ask in the Selectize support channels for that one. I'm not sure how you are currently generating the options for example, but I assume that you could need to add the condition to whatever script you are using for that.

    Can I clear the "user_address" field when "user" is changed? Thanks!

    Yes - use the dependent() to run a function when a field's value is changed - you could have it set the address input to empty for example. Another option is to use field().input() and attach your own event listener.

    Allan

  • dmryzhkovdmryzhkov Posts: 8Questions: 3Answers: 0

    Thanks!

This discussion has been closed.