HTML,使按钮将数据提交到另一个URL? [英] HTML, making a button submit data to another url?

查看:107
本文介绍了HTML,使按钮将数据提交到另一个URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的HTML:

<form class="form-horizontal" method="post">
        <div class="control-group">
            <label class="control-label" for="inputEmail">Email</label>
            <div class="controls">
                <input type="text" id="inputEmail" placeholder="Email">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputPassword">Password</label>
            <div class="controls">
                <input type="password" id="inputPassword" placeholder="Password">
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <label class="checkbox">
                    <input type="checkbox"> Remember me
                </label>
                <button type="submit" class="btn btn-success">Sign in</button>
                <button class="btn btn-primary"> Make a new account </button>
            </div>
        </div>
    </form>

注意:以防万一有人在怀疑,它是在使用引导程序 库.

Note: Just in case someone is wondering, it is utilizing the bootstrap library.

我有表单,并且它发布到login.php,但是我希望按钮Make a new account相同数据发布到register.php.

I have the form and it POSTs to login.php but I want the button Make a new account post the same data to register.php.

有可能吗?如果可以,怎么办?

Is that possible? If so, how?

推荐答案

form标记的action属性设置为页面URL,以将数据发送至该页面.

Set action attribute of your form tag to the URL of the page to send the data to.

这篇关于HTML,使按钮将数据提交到另一个URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆