qerra22 Posted February 12, 2009 Report Share Posted February 12, 2009 (edited) Hi all! Unfortunatley I am not an egghead. I am more a drop head but I am hoping someone can help me. I am wanting away to allow people to fill in a simple excel form via the internet. The closes I hav come is Bad blue however their design is quite poor and very limitted. As this is a like a one of sheet but will be used quite often I am hoping to find a solution to this problem thru maybe some jave scripting or something. Edited March 21, 2009 by qerra22 Quote Link to comment Share on other sites More sharing options...
lwsimon Posted February 12, 2009 Report Share Posted February 12, 2009 Javascript cannot read or write files. You'll need to use server-side code for that. Quote Link to comment Share on other sites More sharing options...
qerra22 Posted December 18, 2009 Author Report Share Posted December 18, 2009 Javascript cannot read or write files. You'll need to use server-side code for that. As all is difficult. Quote Link to comment Share on other sites More sharing options...
Guest go2prashant Posted April 21, 2010 Report Share Posted April 21, 2010 Javascript cannot read or write files. You'll need to use server-side code for that. You are wrong . It is possible to read/write data(anywhere to excel also) using Java Script. Below is thas ample code for this. <html> <script> function mytest1() { var Excel, Book; // Declare the variables Excel = new ActiveXObject("Excel.Application"); // Create the Excel application object. Excel.Visible = false; // Make Excel invisible. Book = Excel.Workbooks.Add() // Create a new work book. Book.ActiveSheet.Cells(1,1).Value = document.all.my_textarea1.value; Book.SaveAs("C:/TEST.xls"); Excel.Quit(); // Close Excel with the Quit method on the Application object. } function mytest2() { var Excel; Excel = new ActiveXObject("Excel.Application"); Excel.Visible = false; form1.my_textarea2.value = Excel.Workbooks.Open("C:/TEST.xls").ActiveSheet.Cells(1,1).Value; Excel.Quit(); } </script> <body> <form name="form1"> <input type=button onClick="mytest1();" value="Send Excel Data"><input type=text name="my_textarea1" size=70 value="enter ur data here"> <br><br> <input type=button onClick="mytest2();" value="Get Excel Data"><input type=text name="my_textarea2" size=70 value="no data collected yet"> </form> </body> </html> Thanks Prashant Quote Link to comment Share on other sites More sharing options...
falkencreative Posted April 21, 2010 Report Share Posted April 21, 2010 Just thought I would point out... I believe the above code would only work if the user is running Internet Explorer with activex enabled -- those visitors who can't run IE (different operating system: OSX, Linux) or prefer not to run IE (Firefox, Safari, Opera...) won't have access to this functionality and it won't work for them. Frankly, I'm glad javascript can't read or write files -- it eliminates a potential security risk. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.