如何将表单提交给2个不同的网址

时间:2013-10-14 23:22:03

标签: jquery ajax forms twitter-bootstrap

我有一个包含4个输入的表单:

  1. 名称
  2. 电子邮件
  3. 优惠券
  4. 条款
  5. 此脚本用于验证wifi系统。系统仅关注凭证值。但我想记录整个表格的记录。

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

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

    感谢您的帮助!!

    <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>    
    

0 个答案:

没有答案