Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
454 views
in Technique[技术] by (71.8m points)

javascript - 如何使用javascript提交表单?(How to submit a form using javascript?)

I have a form with id theForm which has the following div with a submit button inside:(我有一个ID为theForm的表单,该表单具有以下div,其中包含一个提交按钮:)

<div id="placeOrder" style="text-align: right; width: 100%; background-color: white;"> <button type="submit" class='input_submit' style="margin-right: 15px;" onClick="placeOrder()">Place Order </button> </div> When clicked, the function placeOrder() is called.(单击后,将调用placeOrder()函数。) The function changes the innerHTML of the above div to be "processing ..." (so the submit button is now gone).(该函数将上述div的innerHTML更改为“ processing ...”(因此,提交按钮现在消失了)。) The above code works, but now the problem is that I can't get the form to submit!(上面的代码有效,但是现在的问题是我无法提交表单!) I've tried putting this in the placeOrder() function:(我试着把它放在placeOrder()函数中:) document.theForm.submit(); But that doesn't work.(但这是行不通的。) How can I get the form to submit?(我该如何提交表格?)   ask by Nate translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...