im new to coding and new to this forum. For a school project i tried to make a little website but i need to write my "textbox" value to a .txt file, i found a code on internet and i tried it but that didn't worked. Can someone help me ?
Here is the code in html :
<!DOCTYPE html>
<html lang="en-us">
<!--backgroud style-->
<body style="background-color:white;">
<!--receive message-->
<a style="color:black">voici la page de l'admin</a>
<!--form de commande-->
<form onSubmit="WriteToFile(this)">
<label>Type your first name:</label>
<input type="text" name="FirstName" id="firstName" size="20">
<label>Type your last name: </label>
<input type="text" name="LastName" id="lastName" size="20">
<input type="submit" value="submit">
</form>
<!--javascript-->
<script>
function WriteToFile(passForm) {
set fso = CreateObject("Scripting.FileSystemObject");
set s = fso.CreateTextFile("filename.txt", True);
var firstName = document.getElementById('FirstName');
var lastName = document.getElementById('lastName');
s.writeline("First Name :" + FirstName);
s.writeline("Last Name :" + lastName);
s.writeline("-----------------------------");
s.Close();
}
</script>
</body>
</html>