首页 > Web开发 > 详细

jq ajax提交表单中含有隐藏值

时间:2015-03-25 19:02:09      阅读:395      评论:0      收藏:0      [点我收藏+]

错误: Uncaught InvalidStateError: Failed to read the ‘selectionDirection‘ property from ‘HTMLInputElement‘: The input element‘s type (‘hidden‘) does not support selection.

 

解决方法:

   对于具有display:none样式的表单

     在提交时是以hidden的形式提交了,我有一个表单是select ,但是处于某个display:none的Div中,结果提交后JS报错:
Uncaught InvalidStateError: Failed to read the ‘selectionDirection‘ property from ‘HTMLInputElement‘: The input element‘s type (‘hidden‘) does not support selection.
display:none的表单的表单是以hidden形式提交的,我的select虽然是不显示的,但是添加了option选项,导致此问题。直接删掉该不需要显示的select表单就好了。此外,disable的表单,是不会被提交的。如果不想让某个表单可操作同时又需要提交,应该使用readonly属性,而不是disable属性。

 

即,提交的数据必须不是隐藏的

jq ajax提交表单中含有隐藏值

原文:http://www.cnblogs.com/lb12081116/p/4366398.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!