<SELECT multiple="multiple" id="icd9list" name="icd9list" size="2" class="pageText2" style="width:400px;"> </SELECT>
它正确显示在表单上,我可以使用JavaScript添加项目,但是当我去处理表单时,表单操作页面会出现以下错误:
Element ICD9LIST is undefined in FORM.
我在初始表单页面上添加了cfparam标签,以及我收到错误的表单操作页面.
不能为我的生活弄清楚为什么它没有将表单元素传递给动作页面.该方法是post,所以它应该捡起来.页面上的所有其他表单元素都可以正常使用.
<cfform action="updform.cfm" name="custform" method="POST">
我也尝试使用custform.icd9list并得到了同样的问题:
Element ICD9LIST is undefined in CUSTFORM.
这个页面是一些非常遗留的代码,我们无法真正回过头来重构太多.我唯一想到的是,当页面首次加载时,多选选项为空白,然后我们在事后通过弹出窗口中的javascript添加选项.当我在Chrome中检查元素时,在我添加选项后,它们就在那里,但我想知道它是否仍被视为空白的多选列表.我知道如果我删除了多个属性并将表单元素视为单个下拉列表,它在表单转储中显示一个值,但只显示第一个(或任何选定的)值.
开始认为答案可能是填充选项值的隐藏字段,并让表单读取.
向多选列表添加选项是不够的.他们也必须被选中.否则,该列表不被视为 successful control,该字段将不会传递到操作页面(强调我的)A successful control is “valid” for submission. Every successful
control has its control name paired with its current value as part of
the submitted form data set. A successful control must be defined
within a FORM element and must have a control name.However:
- Controls that are disabled cannot be successful.
- If a form contains more than one submit button, only the activated submit button is successful.
- All “on” checkboxes may be successful.
- For radio buttons that share the same value of the name attribute, only the “on” radio button may be successful.
- For menus, the control name is provided by a SELECT element and values are provided by OPTION elements. Only selected options may be
successful. When no options are selected, the control is not
successful and neither the name nor any values are submitted to the
server when the form is submitted.- The current value of a file select is a list of one or more file names. Upon submission of the form, the contents of each file are
submitted with the rest of the form data. The file contents are
packaged according to the form’s content type.- The current value of an object control is determined by the object’s implementation.
我怀疑表单在提交表单之前没有强制项目被“选中”,这就是为什么行动页面上没有显示任何内容的原因.