ColdFusion - Safari 上的表单发布问题,即使是最基本的测试表单:似乎没有数据通过
在将一堆仅适用于 IE 的内容转换为可在其他浏览器上使用时,我在 Safari 浏览器上遇到了一些奇怪的问题。 为了尝试隔离问题,我编写了一个非常基本的测试页,但我仍然无法找出导致问题的原因。
我正在尝试的非常基本的测试形式如下所示:
<form name="testForm" action="test2.cfm" method="post">
<input type="text" name="testField" value="testValue">
<input type="submit" name="go" value="go">
</form>
我想这应该足够简单,对吧?
现在发生的事情是:无论我尝试什么,提交表单的“test2.cfm”页面似乎根本没有收到任何内容。
- 如果我尝试在其中使用“testField”变量,我会收到 CF 错误,因为它未定义,就好像它尚未提交或拼写错误(不用说我对拼写进行了三重检查)
- 如果我尝试循环对于从表单收到的所有数据,我什么也没得到,就好像表单不包含任何内容一样。
上述所有情况仅发生在 Safari 浏览器上,而在 IE、Opera、Firefox、Chrome 上则运行良好。
- 我还尝试通过脚本提交表单而不是使用提交类型按钮,但没有任何改变(并不是我真的期望它会发生变化:我尝试它是出于绝望而不是其他任何事情)
- 我尝试了普通形式和 cfform ,结果还是一样。
我知道我很可能是盲目的/愚蠢的/无论如何,我的大脑感觉可能已经在度假了,因为现在是圣诞节,但我真的不明白这里发生了什么...任何想法都可以帮助小老-菜鸟我出去吗?
While converting a bunch of IE-only stuff to be available for use on other browsers as well, I ran into some weird issue on Safari browser.
In order to try to isolate the issue, I wrote a VERY basic test page, but I still can't get what's causing the problem.
The very basic test form I'm experimenting with looks like this:
<form name="testForm" action="test2.cfm" method="post">
<input type="text" name="testField" value="testValue">
<input type="submit" name="go" value="go">
</form>
I guess that should be simple enough, right?
Now to what's happening: no matter what I try, it seems that the "test2.cfm" page to which the form is submitted does not receive anything at all.
- If I try to use the "testField" variable in it, I get a CF error 'cause it's undefined, as if it hasn't been submitted or it's misspelled (needless to say I triple-checked the spelling)
- If I try to loop on all the data received from the form, I get nothing at all, as if the form did not contain a single thing.
All of the above is happening only on Safari browser, whereas it's working fine as it should on IE, Opera, Firefox, Chrome.
- I also tried to script-submit the form instead of using a submit-type button, but nothing changed (not that I was really expecting it to: I tried it out of desperation more than anything else)
- I tried with both normal form and cfform, and the result is still the same.
I know I'm most probably being blind/dumb/whatever and my brain feels likely already on vacation 'cause it's Xmas time, but I really don't get what's going on here... any ideas anyone to help little-old-noob-me out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经在“Safari 5.1.2 (7534.52.7)”上测试了您的代码,一切正常。我可以在我的操作页面(test2.cfm)中访问“Form.testField”变量。检查操作页面的代码,删除浏览器缓存,然后重试。
I have tested your code on 'Safari 5.1.2 (7534.52.7)' and all are working fine. I am able to access the 'Form.testField' variable in my action page(test2.cfm). Review the code of your action page, remove the browser cache and try again.