输入保存到文件,然后提交到提交的URL

时间:2015-06-19 18:13:07

标签: html form-submit html-form

我有一张表格。现在它有一个动作,只需将输入提交给URL。我希望修改表单完成后,输入保存到文件然后提交到URL。

<form class="snp-subscribeform snp_subscribeform" action="join.cgi" method="post">
    <input name="page" type="hidden" value="1" />
    <div>
        <input id="snp-firstname" class="snp-field snp-field-firstname " name="firstname" required="" type="text" value="" placeholder="Enter Your First Name" />
        <input id="snp-lastname" class="snp-field snp-field-lastname " name="lastname" required="" type="text" value="" placeholder="Enter Your Last Name" />
        <input id="snp_email" class="snp-field snp-field-email" name="email" type="text" placeholder="Enter Your Email " />
        <input id="snp-password" class="snp-field snp-field-password " name="password" required="" type="text" value="" placeholder="Select A Password" />
    </div>
    <div>
        <input class="snp-subscribe-button snp-submit" type="submit" value="CONTINUE" data-loading="Creating Account!" data-success="Account Created!" />
    </div>
</form>
</div>

1 个答案:

答案 0 :(得分:0)

您需要使用javascript和提交按钮的onclick事件来检索您感兴趣的DOM元素中的值并将它们保存到文件中。

以下是如何入门的示例:

<input type="submit" name="submit" value="Save" onclick="writedata()" />

<script>
    function writeData() {
    }
</script>