This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Setting default choice for Matrix
Started 11 years ago by zforray | 7 posts |
-
I need a way to set the default value for each line/row of a matrix.
My scenario is folks have a list of 15-items of which they need to pick "choice #1" "choice #2" and "choice #3".
At first, my matrix had just these three columns. Then folks said if they accidentally picked one, they couldn't "unpick" it. So, I added a 4th column labeled "do not want" to let them "unpick".
But the issue arose that with the field being mandatory, they must pick something on EVERY ROW.
So, my thought is to set the "do not want" column to enabled/picked/set for each row but I don't know how to do this programatically since there doesn't seem to be an option within MachForm
Suggestions/thoughts/ideas on how to handle this?
I haven't installed 3.4, yet but was hoping something in there might address this issue?
Posted 11 years ago # -
Sorry, I'm afraid it won't be possible to set default value for matrix field indeed.
The only workaround I could think of is to create several multiple choice fields and made them inline, so that it would somewhat similar as matrix choice.Or use the matrix checkbox instead, so that they could "unpick" their selection.
They could select multiple answers within a row though, but you can put some instruction there and ask them to only select one answer for each row.MachForm Founder
Posted 11 years ago # -
Making the matrix "multiple answers" is still the same problem. Making it a required field forces a selection on every line/row.
Can I added this to a wish-list for future changes to set a default row value for matrix fields (same as with multiple choice fields)
Posted 11 years ago # -
@zforray: I'm confused. Why are you making the matrix field mandatory if you don't want the user to have to choose something on every row?
Posted 11 years ago # -
This is a grid of 20-items. From these 20-items, they must choose 3 (labeled as columns "Choice 1", "Choice 2", "Choice 3". But they must choose something, thus the requirement/mandatory.
But when you make the field mandatory, it requires a selection in *EVERY ROW*. Plus with the issue of "oops - I didn't mean to select this item so how do I de-select", I added a 4th column labeled "Don't Want This One".
So, I need to be able to initialize EVERY ROW with the "Don't Want This One" column selected/defaulted.
Posted 11 years ago # -
I am still not sure what your matrix looks like, but apparently you have 20 rows with (ideally) three columns. You want your users to be required to pick one and only one item in each column. I assume you are trusting your users to to this properly, because you can't enforce this in a matrix (without custom coding). Because your users sometimes click in a row they do not actually want to make any choice in, you have had to add a fourth "Do not want" column.
If this is correct, then it seems to me that you have your matrix lying on its side. If you make a matrix of three rows (Choice 1, Choice 2, Choice 3) and 20 columns, then your problems all go away. Your users can only make one choice in each row and, if you make the field required, they must make one choice in each row. Since your uses cannot make any extraneous choices, you no longer need the "Do not want" column. The only drawback I can see is that this makes the field very wide. But if you label each column with a letter from A to T (or a number) and use a legend, then you can minimize the width, although you will still have to make the form as a whole wider using advanced CSS.
Posted 11 years ago # -
Your post makes sense, williamsley, and seems to me to be what zforray wants. To avoid the width problm, zforay, you could use three separate multiple choice fields becuase those wrap. And if you create the first one field, you can just copy that one twice to give you three identical fields. You also can now have a "no choice" option and make that your default. What you can't do under any case is avoid users from making the same choice for each of the three rows, but you didn't seem to need that option.
Posted 11 years ago #
Reply
You must log in to post.