所以我有一个带有两个checkbox的form 。 当我调用form.getForm().getValues()并记录values ,它会检索这样的checkbox值:如果选中它,则值看起来像这样 - SomeCheckbox: "on" ,如果没有检查它的值根本不存在。 然后我将这些值编码为JSON并将其发送到ASP.NET MVC,并且这些checkboxes ASP检索值始终为false。 我想出的解决方案是在获取form值后设置我从form检索的values的SomeCheckbox属性,它工作得很好,但是没有其他方法吗?
解:
调用form的getFieldValues()方法而不是getValues()
So I have a form with two checkboxes. When I call form.getForm().getValues() and I log the values, it retrieves checkbox values like this: if it is checked then the value looks like this - SomeCheckbox: "on", and if it's not checked than the value is not there at all. And then I encode those values into JSON and send it to ASP.NET MVC and the values ASP retrieves for these checkboxes are always false. The solution I came up with is to set the SomeCheckbox properties of the values I retrieve from form after getting form values and it works just fine, but is not there any other way ?
SOLUTION:
call form's getFieldValues() method instead of getValues()
最满意答案
调用表单的getFieldValues()方法而不是getValues()
call form's getFieldValues() method instead of getValues()
更多推荐
发布评论