0
I have a form HTML
very simple (I am using it only for testing)
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form</title>
</head>
<body>
<input type="email" placeholder="Digite o seu email" class="email">
<input type="password" placeholder="Digite a sua senha" class="senha">
<input type="button" value="enviar" class="confirma" onclick="MinhaFuncao()">
</body>
</html>
Note that on the last line (line 12) my button has a function JS
that up to now it is like this:
function MinhaFuncao(){
var email = document.getElementById('email').value
var senha = document.getElementById('senha').value
}
What I’d like to do is somehow take these values and write them into a file. txt
Unfortunately I have to really use a txt.
If such an act is not possible with Javascript, there is some way to pass the form information to a file python
or C++
?
for reasons of holding the browser can not write files, can create a code "server side" in python for example, receiving an http request, can if ajax for example, and so yes python can write a file, but note that it may not be on the same user’s machine
– Ricardo Pontual
The most I can do is create and display a link (ancora) in the body of your HTML document whose user can right-click and choose to save this link as and what is saved is a dynamically generated text document (or anything else). I don’t know if it suits you.
– Augusto Vasques