5 months ago

Checkboxes from XML template

Posted 5 months ago by mleontenko

I have the following XML template (I plan to keep it as a separate xml file):

		<name>Option 1</name>
		<name>Option 2</name>
		<name>Option 3</name>
		<name>Option 4</name>
		<name>Option 5</name>

XML template is not mandatory, another format like JSON can be used. I just need to keep my options structured somewhere. Feel free to suggest something else.

I want to generate form with checkboxes for each of these options like this:

The checkboxes would store selections to array options[]

After submitting the form, I want to store this array into a field named "options", table named "record"


	id: 1
	version: "1.0"
	options: [1, 2, 3]

I have a few questions regarding this:

  1. What data type should field "options" be?
  2. Will I be able to query this table for options and how? E. g. I want all records containing option 1
  3. What is the simplest way to generate form with checkboxes from template? Also consider that I want to repopulate selections with values from array in case of editing.

Please sign in or create an account to participate in this conversation.