我正在处理这个简单的网站,我希望能够从表单中获取这些字段中的信息,并将它们保存为纯文本文件(如桌面上的东西)。
以下是我目前的表格:
<form id="mainform" class="pure-form pure-form-aligned">
<fieldset style="padding-top: 12px;">
<div class="pure-control-group">
<input id="service" class="pure-input" type="text" placeholder="Service">
</div>
<div class="pure-control-group">
<input id="username" class="pure-input" type="text" placeholder="Username">
</div>
<div class="pure-control-group">
<input id="email" class="pure-input" type="email" placeholder="Email Address">
</div>
<div class="pure-control-group">
<input id="password" class="pure-input" type="password" placeholder="Password">
</div>
<div class="pure-control-group">
<input id="vpassword" class="pure-inputs" type="password" placeholder="Verify Password">
</div>
<div class="pure-controls" style="margin-left: 0px;">
<button type="submit" class="pure-button pure-button-primary" id="button1" style="
margin-right: 15px; background-color:#99CCFF;">Submit</button>
<button type="submit" class="pure-button pure-button-primary" id="button2" style="
width: 81px;margin-left: 15px;background-color:#99CCFF;">Clear</button>
</div>
</fieldset>
</form>
我在按下提交按钮后知道$POST
,但我认为这会有点不同,因为它会转到文件。可能JS我认为,这就像保存到Java程序中的文本文件一样吗?