我试图弄清楚如何将用户的选择(单选按钮)另存为json对象。
我有两个类别:“公共”和“私人”都有相同的单选按钮列表:
这就是对象最终看起来的样子:
ex: Public: {
shareWithAll
}
ex: Private: {
shareWithAllExcept:{Jim Smith, Tom John, Kim Larry}
}
我该怎么做,还是应该这样做,以便我可以根据用户选择保存字符串或json对象?
这是我的哈巴狗:
b Public
.form-check
input.form-check-input(type="radio" checked)
label None
.form-check
input.form-check-input(type="radio" checked)
label Share All
.form-check
input.form-check-input(type="radio" checked)
label Share With....(toggle inner div with checkboxes of options)
.form-check
input.form-check-input(type="radio" checked)
label Share All Except...(toggle inner div with checkboxes of options)