0

我有一个带有 4 个输入的表单:

  1. 姓名
  2. 电子邮件
  3. 代金券
  4. 条款

此脚本用于验证进入 wifi 系统。系统只关心 Voucher 的价值。但我想记录整个表格以供记录。

有没有办法让系统通过ajax第一次将表单提交到一个url,然后将凭证作为帖子提交?

我在下面附上了我的代码:

谢谢你的帮助 !!

<form data-validate="parsley" data-show-errors="true" data-focus="first" name="input" method="post" action="login">
      <input type="hidden" name="by" value="voucher" />
      <input type="hidden" name="page_error" value="en_.html" />
      <div class="voucher-box">
        <!-- Title or Error -->
        <unifi if="has_error">
          <h2 class="error"><unifi error="error" /></h2>
        <unifi else="has_error" />
          <h2><unifi txt="UseVoucher" /></h2>
        </unifi>
        <fieldset class="large-text">
          <p class="form-element">
          <label for="Name" class="fieldname">Name</label>
            <input id="name" name="name" data-required="true" data-minlength="2" data-error-container="div#error" data-error-message="Please enter your name" type="text"  class="textinput" placeholder="John Smith" value="" autocomplete="on" />
          <label for="E-mail" class="fieldname">Email</label>
            <input id="E-mail" name="E-mail" data-required="true" data-type="email" data-error-container="div#error" data-error-message="Please enter your E-mail adress" type="text" class="textinput" placeholder="John.Smith@me.com" value="" autocomplete="on" />

            <label for="voucher" class="fieldname">Voucher Code</label>
            <input id="voucher" name="voucher" data-minlength="10" data-maxlength="10" data-error-container="div#error" data-required="true" data-error-message="Please enter a correct voucher code" type="text" class="textinput" placeholder="00000-00000" value="" autocomplete="off" />
          </p>
        </fieldset>
      </div>
      <label class="checkbox">
          <input type="checkbox" name="remember" value="0" data-mincheck="1" data-error-container="div#error" data-error-message="Please accept the terms and conditions before conecting"> <a href="#myModal" role="link" class="link" data-toggle="modal">I accept the terms and conditions</a>
        </label>
  <button type="submit" name="connect" type="submit" value="Connect" id="connect" class="btn btn-info btn-block">Connect</button>
    </form>
  </unifi>    
4

0 回答 0