【Sciter】不要尝试对表单中的隐藏项赋值

来源:互联网 发布:js控制video全屏播放 编辑:程序博客网 时间:2024/06/06 02:16
<html><head><script type="text/tiscript">self.on("click", "#b", function(evt) {$(#frm).value = {name:"hello"};//$(#out).value = JSON.stringify($(#frm).value, " ");$(#out).value = String.printf("%V", $(#frm).value);});</script></head><body><form#frm><input|hidden(name)/></form><button#b>reset</button><pre#out/></body></html>

上面的代码将会输出

{name:undefined}

也就是说,对表单中的hidden类型的项赋值会失败。

一开始我以为这是一个BUG,就向作者反馈了这个问题,但作者的回复说就是这么设计的。。。所以,如果碰到相同问题的朋友需要使用其他方法绕开这个限制了

反馈讨论地址:https://sciter.com/forums/topic/form-can-not-set-the-hide-value

原创粉丝点击