Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML/Javascript如何将一个按钮链接到另一个按钮?_Javascript_Jquery_Html_Forms - Fatal编程技术网

HTML/Javascript如何将一个按钮链接到另一个按钮?

HTML/Javascript如何将一个按钮链接到另一个按钮?,javascript,jquery,html,forms,Javascript,Jquery,Html,Forms,救命啊。我想将一个按钮链接到另一个按钮。我有两个.html文件 index.html和output.html 就是这样,, 在我的index.html中,我有一个表单和表单中的一个按钮。只是一个例子 <div id="additionForm"> <form class="form-addition"> Assume that this form requests for two values and will add that values.

救命啊。我想将一个按钮链接到另一个按钮。我有两个.html文件

index.html和output.html

就是这样,, 在我的index.html中,我有一个表单和表单中的一个按钮。只是一个例子

    <div id="additionForm">
    <form class="form-addition">
    Assume that this form requests for two values and will add that values.
    <button type="submit"">ADD</button> 
    </form> </div>

假设此表单请求两个值,并将添加该值。
你可以试试这个

<div id="outputForm">
<form class="form-output">
<button type="button" onclick="location.href='index.html'">Click Me!</button>
</form> </div>

点击我!
您可以试试这个

<div id="outputForm">
<form class="form-output">
<button type="button" onclick="location.href='index.html'">Click Me!</button>
</form> </div>

点击我!

点击我!
函数调用()
{
window.location.href='index.html'
}

点击我!
函数调用()
{
window.location.href='index.html'
}

当您说output.html中的表单将“调用”index.html中的表单时,您的确切意思是什么?您的意思是它将提交包含以前收集的值的早期表单吗?或者您的意思是它将使您能够导航回上一页?index.html中的表单将显示在output.html中,然后我将输入另一个值,如果我按submit,它将再次计算。按钮是从output.html页面点击的,为什么不把两个表单都放在那里呢?你想要什么有点奇怪。你能提供更多的信息“calulate”是什么意思,以及数据应该如何处理吗?当你说output.html中的表单将“调用”index.html中的表单时,你到底是什么意思?您的意思是它将提交包含以前收集的值的早期表单吗?或者您的意思是它将使您能够导航回上一页?index.html中的表单将显示在output.html中,然后我将输入另一个值,如果我按submit,它将再次计算。按钮是从output.html页面点击的,为什么不把两个表单都放在那里呢?你想要什么有点奇怪。您能否提供进一步的信息“calulate”是什么意思以及数据会发生什么情况?虽然此代码可能会回答此问题,但提供有关如何和/或为什么解决此问题的附加上下文将提高答案的长期价值。虽然此代码可能会回答此问题,提供关于如何和/或为什么解决问题的附加上下文将提高答案的长期价值。