开发者

Problems with <form> and Dynamically-generated links

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 help开发者_StackOverflowed!
?>


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();
}


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() 


// 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜