的问题和动态生成的链接

发布于 2024-10-02 10:26:28 字数 667 浏览 3 评论 0原文

与这篇帖子直接相关,我在实施@sean给出的一些合理建议时遇到了困难,因为正如您在此页面上看到的:

http://www.onestopfasteners.com.au/checkout。 php - 我已经将表单标签包裹在表格元素周围,但表单似乎不起作用,也没有任何内容被“POST”。我已经更改了 abit 周围的代码进行实验,但还没有找到解决方案,并且任何地方的搜索都没有被证明是有用的。

我将不胜感激任何帮助。我完全困惑了!

谢谢!

PS 我认为也许我将表单元素包裹在动态生成的内容周围可能是表单不起作用的原因,但这对我来说没有多大意义,而且我以前已经这样做过,所以可以'不会吧,可以吗?

Code:

我知道,很长,提前道歉。 :)

<?php
   // (c) code removed ;) problem solved - thanks to everyone who helped!
?>

Related directly to this post, I am having trouble implementing some sound advice given from @sean, because as you can see on this page:

http://www.onestopfasteners.com.au/checkout.php - I have wrapped the form tags around the table element, but the form just doesn't seem to be working, and nothing ever gets "POST"ed either. I've changed the code around abit to experiment, but haven't found a solution, and no search anywhere has proven to be useful yet.

I'd appreciate any help at all. I'm completely baffled!

Thanks!

P.S. I thought that maybe the fact that I am wrapping form elements around dynamically generated content could be why the form isn't working, but that doesn't make much sense to me and, I've done it before, so that can't be it, can it?

Code:

I know, it's long, apologies in advance. :)

<?php
   // (c) code removed ;) problem solved - thanks to everyone who helped!
?>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

审判长 2024-10-09 10:26:28

我认为你的问题是:

function submit() {

             document.myform.submit();

             }

尝试:

function submit() {

                 document.getElementById('ct_form').submit();

                 }

看起来你在页面中使用 jQuery,所以你也可以使用:

function submit() {
    $('#ct_form').submit();
}

I think your problem is with:

function submit() {

             document.myform.submit();

             }

Try:

function submit() {

                 document.getElementById('ct_form').submit();

                 }

It looks like you are using jQuery in the page so you could also use:

function submit() {
    $('#ct_form').submit();
}
染火枫林 2024-10-09 10:26:28

您使用 javascript 提交表单,但您引用的 document.myform 不存在。

试试这个。

document.getElementById('ct_form').submit() 

Your using javascript to submit the form, but you are referencing document.myform which doesn't exsist.

try this instead.

document.getElementById('ct_form').submit() 
装迷糊 2024-10-09 10:26:28
// do sumbit first form of document 
document.forms[0].submit()

这里不需要 document.getElementById 。顺便说一下,document.myform 依赖于 FORM 元素的 NAME 属性

// do sumbit first form of document 
document.forms[0].submit()

document.getElementById is not necessary here. document.myform relies on NAME attribute of FORM element, by the way

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文