Hey,
So I've got my javascript array (var seatsArray = [];), let's say it has some contents. I want to write the contents of that array to a .txt file on the server when the user clicks a button. The text file will not already exist so it needs to be created.
Also, if anyone knows how I could allow the user to specify the name of the text file to be created by typing it in a text area, that would be great.
Any ideas?
Many thanks John
EDIT:
Added the suggested code, however, nothing happens when I hit save?
<form id="my_form" action="">
<input type="text" id="file_name" rows="1" cols="20">
<a href="javascript: SubmitForm()">Save</a>
</form>
<script type="text/javascript">
function submitform();
{
var d = seatsArray.join();
var url = "/txtfiles/"+d + "&file_name=" +
document.getElementById("file_name").value;
document.getElementById("my_form").action = url;
document.getElementById("my_form").method = "POST";
document.getElementById("my_form").submit();
}
</script>
That is all in the body section.
Thanks