Click here to Skip to main content
12,898,392 members (57,448 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Javascript jQuery HTML5
i am developing mobile web app for conducting survey in html5. i need to save user responses in file preferably in csv format. How can do it? i am stuck with storing part.......... please please help me.

I cannot use activex for dat purpose coz app needs to work on android+ windows tablet.

thanx in advance.
Posted 26-Jul-12 18:16pm
Updated 13-Apr-17 16:52pm
v5
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Does this[^] help?
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

 

<script language="Javascript">
function download(filename, text) {
  var pom = document.createElement('a');
  pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + 
 
encodeURIComponent(text));
  pom.setAttribute('download', filename);
 
  pom.style.display = 'none';
  document.body.appendChild(pom);
 
  pom.click();
 
  document.body.removeChild(pom);
}
 
function addTextHTML()
{
    document.addtext.name.value = document.addtext.name.value + ".html"
}
 
function addTextTXT()
{
    document.addtext.name.value = document.addtext.name.value + ".txt"
}
</script>
 

 

<form name="addtext" onsubmit="download(this['name'].value, this['text'].value)">
 
<textarea rows="10" cols="70" name="text" placeholder="Type your text here:"></textarea>
<br>
<input type="text" name="name" value="" placeholder="File Name">
<input type="submit" onclick="addTextHTML();" value="Save As HTML">
<input type="submit" onclick="addTexttxt();" value="Save As TXT">
 
</form>
 
  Permalink  
Comments
Kats2512 14-Apr-17 1:41am
   
Do you really think the person who asked the question would still be looking for an answer after 5 long years?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.170424.1 | Last Updated 13 Apr 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100