html - How to access information in a javascript file that was send from a form? -


i have following code:

<form action="main.js">         <input type="text" required="required" pattern="[a-za-z]+" />         <input type="submit" value="submit" />     </form> 

when click submit button, information in input should sent file "main.js". there nothing in "main.js". want "main.js" file contain passed information string, there way or method this?

seems you've understood form action incorrectly.

action defines code handle form values, , not page results pasted into.

you'll want main.js receive form results , handle them in way pasted results.txt file example. allowing user of website create or edit files on server insecure.

the option think of, unless have access server side coding, php or asp, sending submitted form information email using mailto:

<!doctype html>  <html>  <body>    <h2>send e-mail someone@example.com:</h2>    <form action="mailto:someone@example.com" method="post" enctype="text/plain">  name:<br>  <input type="text" name="name" value="your name"><br>  e-mail:<br>  <input type="text" name="mail" value="your email"><br>  comment:<br>  <input type="text" name="comment" value="your comment" size="50"><br><br>  <input type="submit" value="send">  <input type="reset" value="reset">  </form>    </body>  </html>

can run asp or php?


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -