我有两种形式,我想同时使用两种形式。我知道可以使用ajax。两种形式一个提交按钮
Form1中
<form action="upload.php" method="post">
<label for="url">Enter URL:</label>
<input type="text" name="url" size="35" /><br/>
<label for="filemam">File Name:</label><br/>
<input type="text" name="filenam" size="35" />
<br/> <input type="submit" name="sut" value="Submit" />
</form>
窗体2
<form method="post" action="forum2_add_:user-prvar-7890:.xhtml:admin-hash-amp:"> <div id="bb"><br/> <img src="http://scodec.xtgem.com/400px-Warning_icon.svg_.png" width="20" height="20"/> <b><font color="#696969">Avoid All Capital Letter on your thread title, special character like (') is not allowed.**</font></b><br/> <b>Thread Title:</b> <input type="text" name="tema_nazov" value="" maxlength="200"/></div> <div id="bb"><br/><b><font color="#696969"> <img src="http://scodec.xtgem.com/400px-Warning_icon.svg_.png" width="20" height="20"/> Article content should be easy to read, easy to understand,presentation clear in order to attract readers.</font></b><br/><b>Content:</b> <br/> <textarea name="text" rows="5"></textarea>
<input type="hidden" name="d_token" value="" /><input type="submit" name="submit" value="Submit" onclick="conti()" style="margin:2px"/></div></form>
</div></div>
注:
我想运行Form1中为Javscript
我想运行form2提交按钮作为onclick。
有人吗?
如果你有一个名为“submit”的表单控件,那么你不能调用表单的提交方法(因为* form.submit *现在引用了控件,而不是方法)。您的markkup还有其他问题。 – RobG
[* MDN *](https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started)介绍了普通JS XMLHttpRequest的基础知识。这真的不难,并且有很多小型图书馆可以提供帮助。 – RobG