Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a CSV file from form data on web page.

Status
Not open for further replies.

sborny

Technical User
Jun 29, 2001
157
GB
Hi all,

I am trying to find out if it is possible to use javascript to take the data entered on a web form and create a csv file from it, that is saved to the server hosting the site.

I have very limited javascript knowledge so any help will be very much appreciated.

Thanks in advance.

Symon

Everything has an answer, it's just knowing the right question to ask. !!!!
 
Javascript running on the client cannot write to a file on the server. For this function, your website must use CGI, PHP, ASP, or other server side programs. Programs running on the server process the data in the form. The process could be a matter of creating a CSV file and saving it in your web space on the server.
 

While you can use Javscript and ActiveX to write to local files, as the previous post mentions, you cannot write to files server-side from your browser.

Your best bet is to use something like ASP or JSP to do this - a task which should be very trivial (most server-side languages have adequate file writing routines, and the structure of a CSV file isn't at all complicated).

So. submit your form server-side and do all the ground work there. This solution also means that your page will work on all browsers and platforms - which wouldn't be the case if you were to do this client-side.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top