問題描述
我有一個經典的 ASP 頁面,它提交回自身.奇怪的是,從選擇返回的值的末尾添加了逗號.有沒有人遇到過這樣的事情?有沒有推薦的故障排除步驟或工具?
I have a classic ASP page that submits back to itself. Strangely, the values being returned from the selects have commas being added to the ends of them. Has anyone run into anything like this before? Any troubleshooting steps or tools recommended?
我希望這些值以數字形式返回 - 它們是選項中顯示的值的 ID.
I'm expecting the values to be returned just as numbers - they are the IDs of the values displayed in the option.
我檢查了頁面中的神秘逗號,但找不到任何 - 也沒有在我正在提取的數據中.
I've checked for mystery commas in the page and can't locate any - nor in the data that I'm pulling through.
(注意 - 這些是單選,而不是多選)
(note - these are single-selects, not multiple)
推薦答案
聽起來您有重復的表單字段.您的值用逗號連接在一起,如下所示:
Sounds like you have duplicate form fields. Your values are concatenated together with commas, like this:
<input type="text" name="name1" value="value1">
<input type="text" name="name1" value="value2">
<input type="text" name="name2" value="value3">
變成
name1=value1,value2
name2=value3
如果第二個name1
沒有值,就變成
If the second name1
has no value, it becomes
name1=value1,
name2=value3
這篇關于在經典 ASP 中添加逗號的 HTML 表單值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!