JavaScript - Pulling Values From Excel File With Js?
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!!!! Similar TutorialsReferring 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'"/> 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 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? How come the below code is not woring for me? when someone comments on my facebook comments plugin I want to get an email. This is what i have 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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '220041184732123', // App ID channelUrl : '//http://www.corkdiscos.com/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); FB.subscribe('comment.create', function(response){ // Here you need to do a call to some service/script/application // to notify your administrator about new comment. // I'll use jQuery ajax to call server-side script to illustrate the flow $.post('mail.php', { "action": "comment created", "url_of_page_comment_leaved_on": response.href, "id_of_comment_object": response.commentID }); }); }; // Load the SDK Asynchronously (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); </script> <div class="fb-comments" notify="true" data-href="http://www.corkdiscos.com/testimonials.html" data-num-posts="30" data-width="544"></div> </body> </html> I then have this php code to send me a mail in a mail.php file PHP Code: <?php $admin_email = 'corkdjs@gmail.com'; $commentID = $_REQUEST['id_of_comment_object']; $page_href = $_REQUEST['url_of_page_comment_leaved_on']; $message = "hello"; mail($admin_email, You have a new comment", $message); ?> what could be wrong and is there anyone that knows how to fix this to make it work? Hello, everyone. I'm not much of a programmer, but I have been tasked with something that's stumping not only me, but my whole dev team as well. We need to find a way to pull a user's NT ID (Windows log on), and store it in a variable for use later on, and also to watermark the screen on HTML pages in an eLearning course. I have no idea how to do this and I can't seem to find anyone who has encountered a need for this. Any suggestions?
I tried to rework a short script to pull info from an iframe instead of the basic page it's sitting on, and I got confused. It's not working. Here's what I've got: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; for (var i=0; i<divCollection.length; i++) { if(innerDoc[i].getAttribute("class") == "list-journal-entry-wrapper") { findMeText = divCollection[i].innerHTML; alert(findMeText); } } } </script> Press the button to find the divs with class "iframeId".<br /> <input type="button" onfocus="this.blur()" value="iframeId" onclick="javascript:find_div_class();return false;""/> I tried another way too, but still nothing: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; var info = document.getElementById("list-journal-entry-wrapper"); alert(list-journal-entry-wrapper); } } } </script> Hello, I hope this is in the right section. I am relatively new to coding and was hoping someone could point me in the right direction because at the time, I don't even know what to start researching in order to figure out how to do this. If you go to www.livingelectro.com, you will see they use the longtail media player(http://www.longtailvideo.com/players/jw-flv-player/) and pull the song to preview from a Zippyshare page. This is the code they use... (notice they do not pull a .mp3 file like I was doing from this code) Quote: <embed height="20" border="0" width="207" style="margin-bottom: 6px;" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="mp3player" quality="high" menu="false" src="http://www.livingelectro.com/mediaplayer.swf?backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xFFFFFF&file=http://www19.zippyshare.com/downloadMusic%3Fkey%3D815431413%26time%3D1249478236&type=flv" allowscriptaccess="never"/> If you look at MY website, (http://www.edmaddicts.net/index.php?...ews&Itemid=107) you will be able to scroll down and see the song preview bars. Originally, I was inserting the Zippyshare file ending in .mp3 and pulling the song up with either of these codes... Quote: <script src="swfobject.js"></script> <div id="player">This text will be replaced</div> <script type="text/javascript"> var so = new SWFObject('player-licensed.swf','mpl','470','20','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=(Zippysharefile.mp3)&backcolor=FFFFFF&lightcolor=660066&screencolor=6 60066&dock=false'); so.write('player'); </script> and also a flash embed code like... Quote: <embed src="player-licensed.swf"width="470"height="20"bgcolor="undefined"allowscriptaccess="always"allowfullscreen="tru e"flashvars="file=(zippysharefile.mp3)&backcolor=FFFFFF&frontcolor=000000&lightcolor=660066&screenco lor=660066&dock=false"/> The Zippyshare file .mp3 is a link stored and pulled up with {FIELDVALUE} in the database. How are they pulling the .mp3 file from Zippyshare so it works everytime? When I insert the .mp3 extension, it only works on my computer and until I reset my cookies. I can NOT host the files on my own website. I am looking forward to learning something. Will Hi.. I should warn, i know almost nothing about javascript. . i've been trying read sample scripts and examples on how to modify this script; but I just don't know enough. I have a script that pulls data from an array, and copies it directly to the clipboard when a user clicks on it. The problem is this only works in IE, because Firefox doesn't by default allow that to happen. I'm trying to change it so that when it is clicked, instead, it takes what was going to be copied to the clipboard, and puts it in a Prompt box for the user to copy and paste. I had other scripts that do that, but I can't for the life of me figure out how to learn from it! This is the function in the current script Code: <script language="javascript" type="text/javascript"> <!-- function selectThis(src) { document.selection.clear; txt = eval(src +".innerText"); theObj = document.all(txt); txtRange = document.body.createTextRange(); txtRange.moveToElementText(eval(src)); txtRange.select(); txtRange.execCommand("RemoveFormat"); txtRange.execCommand("Copy"); alert(txt + " '.$caption[ 'paste' ].'"); } --> </script> '; } and this is the onclick code Code: '; foreach ( $ausgabe as $key => $data) { if ( $key == '' ) continue; if ( ( $_GET[ 'group' ] != '*' ) && ( $this->info[ $key ][ 'xx_data' ] != $_GET[ 'group' ] ) ) continue; $tpack = $this->info[ $key ][ 'pack' ]; $tname = $this->info[ $key ][ 'xx_desc' ]; $jsid= $nick2.'_'.$tpack; if ( isset( $this->info[ $key ][ 'xx_lock' ] ) ) { if ( $this->hide_locked > 0 ) continue; $tname .= ' (gesperrt)'; } $tname = htmlspecialchars( $tname); if ( $javascript > 0 ) { $tname = '<span class="selectable" onclick="javascript:selectThis(\''. $jsid.'\');">'. $tname."</span>\n". '<span id="'.$jsid.'" class="hidden">'. '/msg '.$this->nick.' xdcc send '.$tpack."</span>\n"; } if ( isset( $this->info[ $key ][ 'xx_note' ] ) ) $tname .= '<br>'.$this->info[ $key ][ 'xx_note' ]; $label = "Download mit:\n/msg ".$this->nick.' xdcc send '.$tpack."\n"; if ( isset( $this->info[ $key ][ 'xx_md5' ] ) ) $label .= " \nmd5: ".$this->info[ $key ][ 'xx_md5' ]; if ( isset( $this->info[ $key ][ 'xx_crc' ] ) ) $label .= " \ncrc32: ".$this->info[ $key ][ 'xx_crc' ]; echo ' <tr> <td class="right">#'.$tpack.'</td> <td class="right">'.$this->info[ $key ][ 'xx_gets' ].'</td> <td class="right">'.makesize($this->info[ $key ][ 'size' ]).'</td> <td class="content" title="'.$label.'">'.$tname.'</td> </tr> '; I've spent days at trying to customize it.. but.. i'm not a programmer I was able to get it to open a prompt box, and had it populate with ("copy this code", $variable), but cannot figure out how to have it display the proper values that was clicked on. I have no idea though what is considered efficient either in the code. I hope this isn't considered asking for TOO much help.... Anyone know if there is a way to get the title string from an iframe src coming from another domain?
Hi gud mng, I have one problem... How to process textbox values/ call textbox values in JS through a Java program. My text box values are dates. I have to process these dates. Like in online banking we select day to know our transactions. After submitting we get results. remember my files are in my directory only. No need of database. My files are look like 20100929, 20100930, 20101001 For epoch_classes.js, epoch_styles.css u can download coding from this link : http://www.javascriptkit.com/script/...ch/index.shtml Code: Code: <html> <table width="900" border="0" cellpadding="10" cellspacing="10" style="padding:0"> <tr><td id="leftcolumn" width="170" align="left" valign="top"> <div style="margin-left:0px;margin-top:0px"><h3 class="left"><span class="left_h2">Select Option</span></h3> <a rel="nofollow" target="_top" href="day_wise.htm" >Day-wise</a><br /> <br /> <a rel="nofollow" target="_top" href="between.htm" >Between Days</a> <link rel="stylesheet" type="text/css" href="epoch_styles.css" /> <script type="text/javascript" src="epoch_classes.js"></script> <script type="text/javascript"> var cal1, cal2; window.onload = function () { cal1= new Epoch('epoch_popup','popup',document.getElementById('popup_container1')); cal2= new Epoch('epoch_popup','popup',document.getElementById('popup_container2')); }; /*............*/ function confirmation(f) { var startdate = f.fromdate.value var enddate = f.todate.value var myday=new Date() var yr=myday.getFullYear() var mn=myday.getMonth()+1 var dt=myday.getDate() var today="" var present, ys, ms, ds, ye,me,de, start, end if(mn < 10) { mn = "0" + mn } if(dt <10) { dt = "0" + dt } today= yr + "/" + mn + "/" + dt present=yr + "/" + mn + "/" +dt if (today < startdate ) { alert (" Start date should not be exceed to-day's date " + present ) startdate.focus() return false } if (today < enddate ) { alert (" End date should not be exceed to-day's date " + present ) enddate.focus() return false } if (today == startdate ) { alert(" You are selected to-days date as Starting day" ); } var answer = confirm("Do you want to continue ?") if (answer) { if( startdate < enddate) alert("Dates between " + startdate + " to " + enddate + " are confirmed" ) else alert("Dates between " + enddate + " to " + startdate + " are confirmed" ) } else { alert("Date not confirmed") window.location="to_date.htm"; } ys= startdate.substring(0,4); ms= startdate.substring(5,7); ds= startdate.substring(8,10); start=ys + "" + ms + "" +ds ye= enddate.substring(0,4); me= enddate.substring(5,7); de= enddate.substring(8,10); end=ye + "" + me + "" +de } /*.......................................................*/ </script> <div style="margin-left:100px;"> <body> <style type="text/css"> #conf { margin-left:115px; } </style> <td align="left" valign="top"> <table width="100" border="0" cellpadding="0" cellspacing="0"> <td style="padding-top:0px"> </table> <h4>From Date</h4> <form name= "formbet" id="placeholder" method="post" action="#" > <input id="popup_container1" type="text" name= "fromdate" maxlength="10" size="20"/> <td align="left" valign="top"> <table width="300" border="0" cellpadding="0" cellspacing="0"> <td style="padding-top:20px"> <h4>To Date</h4> <input id="popup_container2" type="text" name= "todate" maxlength="10" size="20"/> <br /> <br /> <input id="conf" type="button" onclick="confirmation(this.form)" value="Submit"> </form> </body> </html> In my coding, ys, ms, ds represents year starting, month starting, starting day... ye, me, de represents end... start,end gives file names in the format of yyyymmdd now i want to process files from 20100101 to 20100930 means from date is 2010/01/01 and to date is 2010/09/30 if i press submit button the files from 20100101 to 20100930 are processes here ys=2010 ms=01 ds =01 and ye=2010 me=09 de= 30 For this how do i call these textbox values (from date text box and todate) to another program (java) Thanks in advance. 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! I have a bunch of checkboxes like below that the user can check some or all and click the button and see the values of all the selected checkboxes. How can I do that? Code: <script> function alertValues(){ } </script> <input type="checkbox" class ="normal2" value="131971" name="list[]" > <input type="checkbox" class ="normal2" value="131973" name="list[]" > <input type="checkbox" class ="normal2" value="131975" name="list[]" > <input type="checkbox" class ="normal2" value="131977" name="list[]" > <input type="button" onClick="alertValues()" Greetings! Im new to this forum, looked around a bit and didnt find anything on this. I im creating a web page, in witch i have to export data from a data base to excel files.. I already have a javascript using activeXobject, that exports the data to an excel table, what i also need to do is to create and pivot table in other excel sheet. Ive been tottaly stuck on this for a couple of days, does anyone have an example of how to create an excel pivot table using JavaScript? I would appreciate it so much =) Thanks in advance! Hello everyone, 'recently converted an excel timesheet to a PDF form. Trying to get some help to convert two excel formulas (formulae?) into javascript. First Excel formula is intended to return the value of "40" if the total is above 40, otherwise display actual value: =IF(L17>40, 40,L17) Second excel formula is the "overtime" field, which displays the number of hrs above 40hrs, or displays "N/A" if below 40: =IF(L17>40, L17-40, "N/A") I have essentially no experience in Javascript and I am trying to learn, but any help to get me over this hump will be appreciated. Regards tim Hi Chaps, I have some Javascript code, that sucessfully exports Project data from an HTML table to an Excel SpreadSheet: Code: function ExportToExcel() { var xlApp = new ActiveXObject("Excel.Application"); // Silent-mode: xlApp.Visible = true; xlApp.DisplayAlerts = false; var xlBook = xlApp.Workbooks.Add(); xlBook.worksheets("Sheet1").activate; var XlSheet = xlBook.activeSheet; XlSheet.Name="Project Details"; // Store the sheet header names in an array var rows = tbldisplay.getElementsByTagName("tr"); var columns = tbldisplay.getElementsByTagName("th"); var data = tbldisplay.getElementsByTagName("td"); //run over the dynamic result table and pull out the values and insert into corresponding Excel cells var d = 0; for (r=4;r<rows.length+3;r++) { // start at row 2 as we've added in headers - so also add in another row! for (c=1;c<columns.length+1;c++) { XlSheet.cells(r,c).value = data[d].innerText; d = d + 1; } } //autofit the columns XlSheet.columns.autofit; // Make visible: xlApp.visible = true; xlApp.DisplayAlerts = true; CollectGarbage(); //xlApp.Quit(); } As you can see, a new workbook is created and the data is exported to Excel ("Sheet1"). What I want to do is as soon as this export is complete, redirect to a seperate page, where the Jobs (linked to the Project) details are exported to Excel ("Sheet2"), without creating a new workbook. Is this do-able? in excel i want to replace the word bebo with a value in cell B1 this is the line CREATE TABLE IF NOT EXISTS `bebo` ( `id` int(10) NOT NULL auto_increment,`beboid` varchar(255) default '0',`status` varchar(255) default 'No Comment Posted',PRIMARY KEY (`id`)) in column B i have a load of values so i need an excel formula to replace bebo so that it will take values from B1 to B26 any ideas please? I know this is not the correct section to be posting in but couldnt find a relative section on this site.. Thanks for your help 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 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 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 For a project in my high school web design class, I need to integrate an Excel spreadsheet as data so to speak for a web page. I want to pull the prices from the sheet, and make them appear on the page. I'd like to pull it from the sheet so that the client can still adjust and edit the prices without having to reach the actual webpage. Conceptually, I thought this would be fairly straight forward, but in researching how to do this, I got very confused. I'm not even positive that I'm putting this in the right section. So my main question is this: Is there a way to integrate an Excel spreadsheet in such a way that it can provide data for certain fields of a webpage? If so, can someone please explain how? Thanks, A Confused High School Girl |