本文介绍了将表单数据保存在文本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我是新用户我想将数据保存在\\10.21.30.44 \ ezeego1 \ test \ BPMI \日常报告\ data.txt尽管d:\\data.txt
请帮帮我。
Hi
I am new user I want to save the data on \\10.21.30.44\ezeego1\test\BPMI\Daily Reports\data.txt inspite of d:\\data.txt
Please help me out .
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>
<SCRIPT LANGUAGE='JavaScript'>
function WriteToFile() {
try {
var fso, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.OpenTextFile("d:\\data.txt" , 8, true, 0);
s.writeline(document.ietmdata.name.value + ", " + document.ietmdata.email.value + ", " +
document.ietmdata.location.value + ", " + document.ietmdata.comments.value + ", " +
document.ietmdata.type.value + ", " + document.ietmdata.problem.value + "," + document.ietmdata.detail.value);
s.Close();
}
catch(err){
var strErr = 'Error:';
strErr += '\nNumber:' + err.number;
strErr += '\nDescription:' + err.description;
document.write(strErr);
}
}
</SCRIPT>
</head>
<BODY>
<form action="test.hta" method="post" name="ietmdata" >
Name: <input type = "text" name="name"><br>
Email: <input type="text" name="email"><br>
Location: <input type = "text" name="location"><br>
Comments: <textarea name="comments"> </textarea><br>
Type: <select name="type" >
<option value="Software"> Software </option>
<option value="Hardware"> Hardware </option>
</select>
<br> <br>
<p> Requesting information:<br>
<select name="problem">
<option value="Option1"> Option1</option>
<option value="Option2"> Option2</option>
</select> </br></p>
<p> Requesting Detail:<br>
<select name="detail">
<option value="Male"> Male</option>
<option value="Female"> Female</option>
</select>
</br></p> <br> <br> <br>
<INPUT TYPE=BUTTON VALUE="Submit Data to Text File" önClick="WriteToFile(this.form)">
</form>
</body></html>
感谢你
Manish Kumar
电邮=== [删除] @ gmail.com
Thanking You
Manish Kumar
Email === [DELETED]@gmail.com
推荐答案
这篇关于将表单数据保存在文本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!