JavaScript - Javascript Code To Fetch Data From 2 Cols Of An Excel File And Upload To Ftp Site
I am trying for a javascript code that would ask for the excel file location when run, fetch data from two columns till eof in an excel file (MS Excel 2010), append it to an existing text file and upload the plain text file to an ftp location.
The ftp username, password and location needs to be hard coded in the script. Is this possible? Similar TutorialsPlease help ... bit urgent I am creating a small automated system where front-end is html query form and back-end database is MS excel. both at local PC only & in a single folder. problem is like a survey form. continuous data entry, error correction, read/wite all these are included. I created a program upto first entry; but the second, third, ... entries and it is continuous. pl help me regards K.Kaniraj I have some data on the client side in javascript arrays that I display to user in a html table on the webpage. I want to give an option to the user to save the data in excel. I thought of a solution that involves: 1. Create an http request and post the data as json 2. On server using jsp convert the json data to html table 3. Set the response headers to open the response in excel This solution works, but does not look optimal. Why to send a http request to server when all the data is there on client side. I tried creating a new document on the client side and open that in a new window. That does not open the document in excel as the response header is not set. Any suggestions on how to achieve this. I want to avoid http request to server. Thanks, Pawinder Hi, I am new to javascript, Please help me with the issue below. My javascript code below should actually fetch the data from html table on button click. function displaymessage() { alert ("button pressed"); var table_cells = new Array(); var table7 = document.getElementById('Auth'); for (i=0,n=table7.rows.length; i < n ; i++) { var Rowdata = table7.rows[i]; table_cells[i] = new Array(); for(j=0,cols = Rowdata.cells.length; j < cols; j++) { table_cells[i,j] = Rowdata.cells[j].innerHTML; alert (table_cells[i,j]); } } alert (table_cells[1,1]); alert (table_cells[2,1]); alert (table_cells[3,1]); alert (table_cells[4,1]); alert (table_cells[5,1]); alert (table_cells[6,1]); alert (table_cells[7,1]); alert (table_cells[8,1]); } The problem with my code above is that the statement "alert (table_cells[i,j]);" executes properly and shows the correct value. But the other alert statements shows only the value of the last row of the table. i.e., my table has 9 rows. and all the alert statements shows 9th row's 2nd column's value outside the for loop. But inside the for loop it executes fine. I tried it in IE7. I seem to miss something. Could someone please help me out with this? Thanks in advance. Hi there, I would like to know how I can show the line "Attach another File" right away, instead of what is depicted in my own code of showing it after a file has been attached. Also, I would like to align "Attach another File" to the right, so that the word "file" will be below the Browse button. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Untitled Page</title> <script language="javascript" type="text/javascript"> var upload_number; function addFileInput() { var d = document.createElement("div"); var file = document.createElement("input"); file.setAttribute("type", "file"); file.setAttribute("name", "attachment"+upload_number); d.appendChild(file); document.getElementById("moreUploads").appendChild(d); upload_number++; } </script> </head> <body> <input type="file" name="attachment" id="attachment" onchange="document.getElementById('moreUploadsLink').style.display = 'block';" /> <div id="moreUploads"></div> <div id="moreUploadsLink" style="display:none;"><a href="javascript:addFileInput();">Attach another File</a></div> </body> </html> Hi there, I have a File Upload tool and would like to prevent the users from clicking on the textbox to upload files. Also, I want to disallow the manual entering of file pathname. How should I edit it? I would need to use Javascript. <input type="file" name="attachment" id="attachment" style="width:300px" /> I'm attempting to pull the hidden iframe file upload trick using javascript. I've go my form file upload and iframe fine, but I can't figure out what to do when it gets server side. There seems to be relatively no documentation on how to handle uploaded files in server-side javascript. Ideas? I'm at a loss.
Hi everybody, I have this File Upload control, whereby the user is granted a limit of 5 uploads. And so, the user clicks on "Attach Another File", and decides to attach a file ONLY in the first File Upload control. My problem is, I want the user to be able to click on an "X" beside every File Upload control, so that it will close those unnecessary (or unused) FIle Upload controls. How do I edit my code in JAVASCRIPT? Please advise. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script language="javascript" type="text/javascript"> var fileCount = 1; function addOneFile() { ++fileCount; var div = document.getElementById("showFile"+fileCount); if ( div != null ) div.style.display = "block"; } </script> <style type ="text/css"> .style37 { color: Black; margin-left: 99px; } </style> </head> <body> <table cellpadding="5"> <tr> <td style="vertical-align: top"> Attachment: </td> <td> <input type="file" name="attachment" id="attachment" style="width:230px" /> <div id="showFile2" style="display: none;"> <input name="file2" type="file" /> </div> <div id="showFile3" style="display: none;"> <input name="file3" type="file" /> </div> <div id="showFile4" style="display: none;"> <input name="file4" type="file" /> </div> <div id="showFile5" style="display: none;"> <input name="file5" type="file" /> </div> <br /> <a href="javascript:addOneFile();" class="style37">Attach another File</a> <br /> (Restricted to 5 uploads) </td> </tr> </table> </body> </html> So I have a file that factors quadratics. It works just fine when I open the file from my desktop, but when I upload it and try to use it, the javascript stops working. Any ideas? This is the file: http://wdroom.com/factor.html You can try it out there, or you can download it. I can't get it to work at all for some reason... Thanks! Hi all.... newbie here. Have just finished my eccomerce site and it's ready to go but have come across a stumbling block. I use webplus4 which is a great web design program... except for one thing. The site search tool is very weak... it won't find results for words of less than 4 characters... and since my website is about plush pets this is important. For instance if you type in the breed 'pug' it says 0 results found. Same if you enter Old English Sheepdog, it ignores the entire search term because of the world 'old'. If you enter plush pug, it also ignores the entire search string. I don't have the money to purchase software nor the time and then configure the javascript to match my site. Is there anyone out there that can modify the following javascript file (jsSiteSearch.js) so that the search will not ignore words of 3 letters? Am aware that once modified I will have to replace the file each time but it will be worth it. By the way, no one on the webplus forums seems to know how to do it. Here is the code... (have removed all the keywords)... function GetSiteSearchResults(newWindow,frameObject,frameObjectName,fontFace,fontSize,fontColour,linkFace,lin kSize,linkColour,resultsText) { var sTerms=""; var iDepth = 0; var sURL = new String(document.location); if (sURL.indexOf("?") > 0) { var arrParams = sURL.split("?"); var arrURLParams = arrParams[1].split("&"); for (var i=0;i<arrURLParams.length;i++) { var sParam = arrURLParams[i].split("="); var sValue = unescape(sParam[1]); if( sParam[0] == frameObjectName) sTerms = sValue; if( sParam[0] == "depth") iDepth = parseInt(sValue); } } var d=frameObject.document; if (sTerms=="") {d.open(); d.write("<html><head></head><body style=\"background: transparent;\"></body></html>"); d.close();return;} var sBack=""; for (i=0; i<iDepth; i++) sBack+='..\\\\'; d.open(); d.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); d.write("<html lang=\"en\">"); d.write("<head>"); d.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"); d.write("</head>"); d.write("<body style=\"margin: 0px 0px 0px 0px; font-family: "+fontFace+"; font-size: "+fontSize+"; color: "+fontColour+"; background: transparent;\">"); d.write("<div id=\"wpSearchResults\"></div>"); d.write("<script type=\"text/javascript\">"); d.write("var wordMap = new Array(\"...........................................); d.write("function doNav(ind)"); d.write("{"); if (newWindow) d.write(" window.open(\""+sBack+"\"+linkMap[ind],\"_blank\");"); else d.write(" parent.window.location.href=linkMap[ind];"); d.write("}"); d.write("function wpDoSearch(searchTerms){"); d.write("var terms = searchTerms.split(\" \");"); d.write("if (terms==\"\") return;"); d.write("var results = \"\";"); d.write("var resultscount = 0;"); d.write("for (var i=0; i<wordMap.length; i++)"); d.write("{"); d.write(" var found=true;"); d.write(" for (var j=0; j<terms.length; j++)"); d.write(" if (wordMap[i].indexOf(terms[j].toLowerCase())==-1) found=false;"); d.write(" if (found)"); d.write(" {"); d.write(" results+=\"<a style=\\\"cursor: pointer; font-family: "+linkFace+"; font-size: "+linkSize+"; color: "+linkColour+"; \\\" onclick=\\\"doNav(\"+i+\");\\\"><u>\"+pageMap[i]+\"</u></a><br>\"+preMap[i]+\"...<br><br>\";"); d.write(" resultscount++;"); d.write(" }"); d.write("}"); d.write("document.getElementById(\"wpSearchResults\").innerHTML=resultscount+\" "+resultsText+" \"+searchTerms+\"<br><br>\"+results;"); d.write("}"); while(sTerms.indexOf("\"") != -1 ) { sTerms = sTerms.replace("\"",""); }; d.write("wpDoSearch(\""+sTerms+"\");"); d.write("</script>"); d.write("</body></html>"); d.close(); } Thanks so very much in advance. Any help asap will be much appreciated. Cheers Hi All. I have a dropdown list on a web form containing dates. My Question: How can I call data for that selected item(date) from a MySQL database and display it to the user? And more specifically, if that selected date has no data in the data base, I want to be able to display that as well. I'm looking for a Javascript solution, and if possible a php solution. Thank You! Hello, I am working on a project using (currently) HTML and javascript to allow the user to choose a vehicle from a drop down menu, then load a new page showing some information about this vehicle. The information is stored in two forms: SQL and Excel. I am looking for a way to use my HTML/javascript code to load the data from one of these files without having to code each option individually. Important note: this will not use the internet at all: all of these files will be available locally. There is a lot of material on running queries to servers, but I didn't think that would really apply here. Ideally the code would populate variables based on cells referenced in the Excel files (as I am familiar with Excel, but havne't used SQL at all). Thank you, klarosa Edit: The users for this will all be using IE7 Hello All, I always wonder that how to display any sort of data or HTML codes by just simply calling or including a Javascript file in other HTML file or a webpage. If you didn't understand what I want to say, I would like to give an example like AdSense gives a javascript code that need to be put where we want to show ads. And the ads appear, similarly how to display any HTML code with just inclusion of Javascript file. An other example is - <script type="text/javascript" src="http://example.com/scripts/javascript/source/somescript.js"> <div id="div_one"></div> <div id="div_two"></div> <div id="div_three"></div> </script> Now this script will show some HTML inside first div, some on second and so on. So How can I do that, please explain with an example... Thanks. I am working on some sort of a program that will load data from a notepad or Excel file and load it into a ComboBox. The notepad file would have names and phone numbers in it. The ComboBox would only show their names in alphabetical order. There would also be a button that when you click it, it would open up Outlook (if you are signed into Outlook) and auto-fill the form with their phone number @ vtext.net (for texting verizon cell phones). The reason behind this is so the notepad or Excel file can be edited to add more users as the company expands. I'm on a time crunch and haven't really been able to figure out how to do the data on load. If anyone could help and explain their code a little bit I would be very grateful. I haven't touched JavaScript in around 5 years so I'm very rusty. Thanks. Guys, this is a script which runs on a Mac not a browser. I have created a script which transfers data from an Excel CSV file into an In-Design document and formats it, I am now just trying to take out some of the options for human error. I need the script to Open the Excel file which has been selected by dialog box and then save it to the desktop as a csv file. I thought this bit would be simple, but I cannot get the file to even open. Help please, Nick Referring to following link, I would like to determine the link for "In-Depth.xls", based on following coding, I find related information for Excel.png, does anyone have any suggestions on how to determine the URL for Excel file? Thanks in advance for any suggestions http://fx.aastocks.com/en/forex/mark...0&indicator=47 <img src="../../images/common/Excel.png" id="cp_imgExcel" class="btn" onclick="window.location.href='dbindepth.aspx?country=66970&startdate=2010/12/24&enddate=2011/12/24&indicator=47&excel=1'"/> I am creating a template generator page that generates a webpage based on what I fill in for certain elements like image name, img src, book title, book author, etc. and these values are sent to me in an excel document which right now I just open and copy and paste everything from the excel document into the form fields for each section. So for example the client sends over a list of book titles they want featured on the page this week and they include author name, author link, book name, book url, img src, etc. and I just copy those new fields into my template and then click generate and the updated HTML code is there for me to copy. This part works totally fine but in the interest of saving time copying upwards of 100 fields from an Excel file into my template, is there a way I can select the excel file (stored locally) on my page with a "browse" directory form and then have a button that runs SQL queries on my Excel document to pull these updated titles, images, etc into my form fields dynamically? Do I need to utilize server technology for this or is there a simple script that when I click a button, will look at whatever excel file I have selected and say "grab this row at this column"? What is the best way to do this? Help! I'm relatively a noob when it comes to this stuff but I do know javavscript and SQL pretty well. I just can't figure out how to access my excel file to pull in the updated information. The excel file's row and column structure never changes, just the content on each row and column. Let me know if you can help. Thanks!!!! Can you place java code in an external javascript file (.js). For example can I do the following in my xx.js file. $(document).ready(function(){ <% execute some java code here %> ...execute some javascript code here... }) Can I do the above? Another question ... I know <% %> is to execute java code inside html. But what does <%-- - -%> mean? Thanks for any help. I have some HTML that I want to put in a Javascript file and reference the HTML through external Javascript file. So I have my page, example.html Code: <html> <head></head> <body> <script type="text/javascript src="../js/external.js"> </script> </body> </html> external.js Code: document.write("<p class="txt_medium style4"> example.com<br />101 Street St.<br />City, ST, ZIP</p><p class="txt_medium style4">"The Best website." </p>"); The above code is all on one line, but is not displaying on the page. PHP is out of the question too (_._) Any thoughts? How do I use Javascript to loop through all the spreadsheets contained in 1 excel file? I am now at the stage where I can open the Excel file and find a value on 1 spreadsheet. Is there any way to detect if the workbook has multiple spreadsheets and then loop through all the spreadsheets to find a value? thanks! Hi, I am trying to convert this excel formula into a Javascript equivalent for a form I am doing in Acrobat Pro 9 and you guessed it. I have no idea. everything is done apart from this. =SUMIF(B2:B29,"LA",A2:A29)+SUMIF(F2:F29,"LA",E2:E2 9) any help very appreciated. cheers |