不同的按钮输入可以打开新页面吗?
P粉450079266
P粉450079266 2024-04-02 12:06:54
0
2
432

<form id="signup">
  <div class="row">
    <div class="col-xs-12 col-sm-6">
      <div class="form-group">

        <input type="text" class="form-control" id="first_name" placeholder="First Name" required data-validation-required-message="Please enter your name." autocomplete="off">
        <p class="help-block text-danger"></p>
      </div>
    </div>
    <div class="col-xs-12 col-sm-6">
      <div class="form-group">

        <input type="text" class="form-control" id="last_name" placeholder="Last Name" required data-validation-required-message="Please enter your name." autocomplete="off">
        <p class="help-block text-danger"></p>
      </div>
    </div>
  </div>
  <div class="form-group">

    <input type="email" class="form-control" id="email" placeholder="Your Email" required data-validation-required-message="Please enter your email address." autocomplete="off">
    <p class="help-block text-danger"></p>
  </div>
  <div class="form-group">

    <input type="tel" class="form-control" id="phone" placeholder="Your Phone" required data-validation-required-message="Please enter your phone number." autocomplete="off">
    <p class="help-block text-danger"></p>
  </div>
  <div class="form-group">

    <input type="addr" class="form-control" id="address" placeholder="Address" required data-validation-required-message="Please enter your phone number." autocomplete="off">
    <p class="help-block text-danger"></p>
  </div>
  <div class="form-group">

    <input type="password" class="form-control" id="password" placeholder="Password" required data-validation-required-message="Please enter your password" autocomplete="off">
    <p class="help-block text-danger"></p>
  </div>
  <div class="form-group">

    <input type="password" class="form-control" id="password" placeholder="Confirm Password" required data-validation-required-message="Please enter your password" autocomplete="off">
    <p class="help-block text-danger"></p>
  </div>
  <div class="mrgn-30-top">
    <button type="submit" class="btn btn-larger btn-block" onclick="rdt()">
                  Sign up as customer
                </button>
  </div>

  <div class="mrgn-30-top">
    <button type="submit" class="btn btn-larger btn-block">
                    Sign up as Shop Owner
                  </button>
  </div>

  <div class="redirect">
    <p>Already have an account? <a href="file:///Users/megatron/Documents/Project/The_Isle_of_Kitchens/Login/login.html">Login Here</a></p>
  </div>
</form>

当用户单击“注册为店主”按钮时,我想转到一个新的 HTML 页面。我在该部分使用了标签,但它不起作用,我将如何在该部分使用标签,或者有​​其他方法来解决它吗? 请给我建议解决问题的方法。

P粉450079266
P粉450079266

全部回复(2)
P粉515066518

使用 target="_blank"in 作为 <a> 标记的属性将在新选项卡中打开链接。

示例在这里。 https://www.w3schools.com/tags/att_a_target.asp

P粉834840856

查看可用于 <form>不同类型的属性元素。

特别是:

  • target 将很有用,因为它指定了 from 响应将返回到的位置。 (通常这是您所在的页面:target="_self"
  • 如果您想指定不同的端点来将 form 数据提交到,action 将会很有帮助
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板