JavaScript - Jscript Html An Excel 2003 Web Import
hi guys,
I have built an rss ripper, the point is to bypass technology restrictions when exporting from sharepoint to excel 2003. My problem i'm using the code below to output data in a nice html tabular format, however when trying to import into excel via web query i get no data returned, i think this is as it isn't real html, i've made a few alterations and am now getting account pulled back - how do i get it to pull all the data ? code is as follows, also i've put a link at the bottom to w3 so you can get a good idea of the issue: <%@ Language=VBScript %> <html> <head> <script type="text/javascript" src="loadxmldoc.js"></script> </head> <body> <script type="text/javascript"> function loadXMLDoc() { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET","my file path",false); xhttp.send(); return xhttp.responseXML; } xmlDoc=loadXMLDoc(""); uppernum=(xmlDoc.getElementsByTagName( "title" ).length ); accstartnum=2 detstartnum=1 qlow = 0 qhi = 12 //document.write("<table border=1") </script><table border = 1><tr><script> z=xmlDoc.getElementsByTagName("description")[detstartnum] </script><td>Account</td><script> y=z.childNodes[0]; data_dump = (y.nodeValue); data_dump = data_dump.replace(/<div><b>/g,""); data_dump = data_dump.replace(/div>/g,""); data_dump = data_dump.replace(/b>/g,""); data_dump = data_dump.replace(/</g,""); data_dump = data_dump.replace(/\n/g,""); data_dump = data_dump.replace(/\//g,""); data_array = data_dump.split(":"); array_pos = 0 while (array_pos < data_array.length) { if (array_pos%2) { document.write ("<td>" + data_array[array_pos] + "</td>"); array_pos+=1; } else { array_pos+=1; } } document.write("</tr>") while (accstartnum < uppernum) { document.write("<tr>") x=xmlDoc.getElementsByTagName("title")[accstartnum] y=x.childNodes[0]; acc = (y.nodeValue); z=xmlDoc.getElementsByTagName("description")[detstartnum] y=z.childNodes[0]; data_dump = (y.nodeValue); data_dump = data_dump.replace(/<div><b>/g,""); data_dump = data_dump.replace(/div>/g,""); data_dump = data_dump.replace(/b>/g,""); data_dump = data_dump.replace(/</g,""); data_dump = data_dump.replace(/\n/g,""); data_dump = data_dump.replace(/\//g,""); data_array = data_dump.split(":"); array_pos = 1 document.write("<td>" + acc + "</td>") while (array_pos < data_array.length) { if (array_pos%2) { array_pos+=1; } else { document.write ("<td>" + data_array[array_pos] + "</td>") array_pos+=1; } } accstartnum+=1; detstartnum+=1; document.write("</tr>") } </script></table><script> //url = document.location.href; //urll = url.split("?"); //if (urll.length == 0) // { // document.self.location.replace("http://midevsso.gcf-uk.gcf.capital.ge.com/Development/rssreader.asp?reload=1"); // } </script> </body> </html> if you have excel 2003 you can get an idea of the issue by trying to import the table he http://www.w3schools.com/XML/tryit.a..._display_table Similar Tutorialshi i am trying to populate a textarea with the selections like checkboxes radiobuttons textbox combobox but i cant seem to do so. i am naive to the field of programing, and found a few code snippets to do so i tried but it did no good... help needed this is my code " <html> <head> <style type="text/css"> .minitext { font: normal 0.7em Arial, sans-serif; color: Black; } .disable { background-color: #CF110C; color: #fff; font-weight: bold; padding: 5px; } </style> <script language="Javascript" type="text/javascript"> function populateTextArea(){ var output = new Array(); var fieldID = 1; while (fieldObj = document.MyForm['iid'+fieldID]) { if (fieldObj.length) { for (var j=0; j<fieldObj.length; j++) { if (fieldObj[j].checked) { output[output.length] = fieldObj[j].value;} }//end of for } //end of if else { if (fieldObj.checked) { output[output.length] = fieldObj.value; } }//end of else fieldID++; }// end of while document.getElementById('targetarea').value = output.join(', '); //document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value ; } </script> </head> <body> <br> <br> <form name="MyForm" method="POST" action="#"> String 1: <input type="text" name="ip1" value=""><br> String 2: <input type="text" name="ip2" value=""><br> String 3: <input type="text" name="ip3" value=""><br><br> <input type="checkbox" name="iid1" id="pe_item2" value="Text string 1"> Text string <input type="checkbox" name="iid1" id="pe_item2" value="Text string 12"> Text string 1<br><br><br> <input type="radio" name="iid2" id="pe_item4" value="Text string 2">Text string 2 <input type="radio" name="iid2" id="pe_item6" value="Text string 3">Text string 3<br> <input type="radio" name="iid3" id="pe_item8" value="Text string 4">Text string 4 <input type="radio" name="iid3" id="pe_item10" value="Text string 5">Text string 5<br> <input type="radio" name="iid4" id="pe_item12" value="Text string 6">Text string 6 <input type="radio" name="iid4" id="pe_item14" value="Text string 7">Text string 7<br> <br> <br> <a href="#" onClick="document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value + populateTextArea();" >Populate</a><br> <br> <INPUT TYPE=BUTTON VALUE="Co" ONCLICK= populateTextArea(); > <br> <textarea id="targetarea" name ="targetarea" cols="50" rows="5"></textarea> </form> </body> </html> " help need this done urgently Hey guys so im kind of lost right now. I am trying to import html files directly from a website. How is the best way about doing this? I need to do this over and over again, at least every 2 seconds. My friend said there was a http/https send command or something? Anyone know? Thanks Hi Chaps, I have a Javascript ActiveX function that exports the contents of an HTML table into MS Excel. The script works fine, however, some of the dates have changed from dd/mm/yyyy to mm/dd/yyyy. I do not know why this is happening, especially as it's only to a few. Here is the code: Code: <script language="javascript" type="text/javascript"> function ExportToExcel() { input_box=confirm("Export to Microsoft Excel?"); if (input_box==true) { 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="Report"; // Store the sheet header names in an array var rows = tblreport_work.getElementsByTagName("tr"); var columns = tblreport_work.getElementsByTagName("th"); var data = tblreport_work.getElementsByTagName("td"); // Set Excel Column Headers and formatting from array for(i=0;i<columns.length;i++){ XlSheet.cells(1).value= "Projects - Open"; XlSheet.cells(3,i+1).value= columns[i].innerText; //XlSheetHeader[i]; XlSheet.cells(3,i+1).font.color="6"; XlSheet.cells(3,i+1).font.bold="true"; XlSheet.cells(3,i+1).interior.colorindex="37"; XlSheet.Range("B1:F1000").HorizontalAlignment = -4108; XlSheet.Range("H1:H1000").HorizontalAlignment = -4108; XlSheet.Range("J1:J1000").HorizontalAlignment = -4108; } //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(); } } </script> Date Columns: F,G,I If anyone has some ideas on how to correct this, I'd be most grateful! First off... I am new to javascript, and am learning while trying to add some cool extra features to an existing project. An existing JSP is generating the HTML page and table. I have retro-fitted it so that it adds to each input field a 'trigger' to the onkeyup event. The purpose of this trigger is check for the the cursor keys being pressed (UP, DOWN, LEFT, RIGHT) and then if it is a logically valid move, shift to the next cell in that direction. Code: <td class="inputField" rowspan="1" colspan="1" nowrap="nowrap"> <input name="ColorNumber0" id="" maxlength="" size="20" onchange="saveFieldObj(this)" onkeyup="return doOnKeyUp(event, 18, 14, 'ColorNumber0')" type="text"> </td> Now, the function it calls, doOnKeyUp, for the most part is working fine... when the input field in the table cells are a textbox or textarea, my method can re-focus the fields appropriately. HOWEVER, I am having a huge headache when the input field is a combo box. Basically, the value of the combo box is changed with the cursor keys (which is default combo box behaviour (I think)), instead of moving to the next editable cell in that chosen direction. Problem #1: My question: Is there a way to intercept/override the various onKey events or similar for the combo boxes. For the combo boxes, I want to continue to move between table cells UNLESS a do something specific, like press the spacebar to entire an update/modification mode for the current cell. Everything I have done so far does not prevent the combo box events from triggering. Any ideas? Problem #2: Also, I tried a nasty hack to try and get it to work, by trying to switch the combo box's value back 1 spot (if it appeared to be needed) by changing the <combo box>.selected value. However, that change never appears to be taking hold, so it is staying at whatever the original selected value was. For this one, I am just curious as to the correct way to have javascript change the selected value in a combo box and make it "stick" and make it applied to the view/UI? Code example: Code: var selectedIdx = (curObj.selectedIndex - 0); if ( selectedIdx < curObj.length ) { var newIdx = (selectedIdx-0) - 1; curObj[selectedIdx].selected = "0"; curObj[newIdx].selected = "1"; curObj[newIdx].focus(); //curObj.selectedIndex = newIdx; } You can probably tell by the code that I had been trying various things to change the combo box's selection via javascript, but none has worked for me. Any help on either topic would be greatly appreciated! hey guys, i know this really hot girl and need to make her think we are right for eachother, to do this i need to 'tweak' a lovetest. i know the love test's answer depends on the number of the letters L,O,V,E,Y,O,U but i need an if function that adds up both name boxes and adds to 100%. here is code: // Made by ADAM - roflmao456 var test = ''; function checkLove(){ var l1 = test.GetControlText('love1'); var l2 = test.GetControlText('love2'); first = l1.toUpperCase(); firstlength = l1.length; second = l2.toUpperCase(); secondlength = l2.length; var LoveCount=0; for (Count=0; Count < firstlength; Count++) { letter1=first.substring(Count,Count+1); if (letter1=='L') LoveCount+=2; if (letter1=='O') LoveCount+=2; if (letter1=='V') LoveCount+=2; if (letter1=='E') LoveCount+=2; if (letter1=='Y') LoveCount+=3; if (letter1=='O') LoveCount+=1; if (letter1=='U') LoveCount+=3; } for (Count=0; Count < secondlength; Count++) { letter2=second.substring(Count,Count+1); if (letter2=='L') LoveCount+=2; if (letter2=='O') LoveCount+=2; if (letter2=='V') LoveCount+=2; if (letter2=='E') LoveCount+=2; if (letter2=='Y') LoveCount+=3; if (letter2=='O') LoveCount+=1; if (letter2=='U') LoveCount+=3; } amount=0; if (LoveCount> 0) amount= 5-((firstlength+secondlength)/2) if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2) if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2) if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2) if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2) if (LoveCount>10) amount= 50-((firstlength+secondlength)/2) if (LoveCount>12) amount= 60-((firstlength+secondlength)/2) if (LoveCount>14) amount= 70-((firstlength+secondlength)/2) if (LoveCount>16) amount= 80-((firstlength+secondlength)/2) if (LoveCount>18) amount= 90-((firstlength+secondlength)/2) if (LoveCount>20) amount=100-((firstlength+secondlength)/2) if (LoveCount>22) amount=110-((firstlength+secondlength)/2) if (firstlength==0 || secondlength==0) amount= "Err"; if (amount < 0) amount= 0; if (amount >99) amount=99; test.SetControlText('loveOutput',amount+"%"); return "[c=12]"+test.GetControlText('love1')+"[/c] + [c=29]"+test.GetControlText('love2')+"[/c] = [c=3]"+amount+"[/c]%"; } function OnGetScriptMenu(){ var ScriptMenu = "<ScriptMenu>"; ScriptMenu += "<MenuEntry Id='lovetest'>"; ScriptMenu += "Love Test"; ScriptMenu += "</MenuEntry>"; ScriptMenu += "</ScriptMenu>"; return ScriptMenu; } function OnEvent_MenuClicked(sMenuId){ if(sMenuId == "lovetest") {test = MsgPlus.CreateWnd("windows.xml","tester");} } function sendResult(){ for (var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext()){ if(test.GetControlText('love1')){ if(test.GetControlText('love2')){ e.item().SendMessage(checkLove()); } else { MsgPlus.DisplayToast("Love Test","Please enter in something in box 2."); } } else { MsgPlus.DisplayToast("Love Test","Please enter in something in box 1.") }}} function OntesterEvent_CtrlClicked(PlusWnd, ControlId){ if(ControlId == "startTest") {checkLove();} else if(ControlId == "sendResults") {sendResult();} else if(ControlId == "BtnClose") {PlusWnd.Close(1);} } END OF CODE please reply with a fixed script with a line like %=50+50 or something so the output is 100%. thanks I'm going crazy trying to figure this out. What I'm looking for is a javascript timer / count down script. When the hours, minutes and seconds hit 0, I need a button the page to become enabled and I also need a button to pause the timer and start it. I have the following code so far. Willing to pay $50 for solution...
Code: <html> <head> <title>Countdown</title> <script type="text/javascript"> // how many minutes var mins = 30; // how many seconds var secs = mins * 60; function countdown() { setTimeout('Decrement()',1000); } function Decrement() { if (document.getElementById) { minutes = document.getElementById("minutes"); seconds = document.getElementById("seconds"); // if less than a minute remaining if (seconds < 59) { seconds.value = secs; } else { minutes.value = getminutes(); seconds.value = getseconds(); } secs--; if(secs > 0) { setTimeout('Decrement()',1000); } } } function getminutes() { // minutes is seconds divided by 60, rounded down mins = Math.floor(secs / 60); return mins; } function getseconds() { // take mins remaining (as seconds) away from total seconds remaining return secs-Math.round(mins *60); } </script> </head> <body onload="countdown();"> Countdown: <form><input id="minutes" type="text" style="width: 22px;"> minutes <input id="seconds" type="text" style="width: 22px"> seconds remaining.</form> </body> </html> Can someone please convert this vbscript to jscript. Thank you. Code: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\scripts""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo objLatestEvent.TargetInstance.PartComponent Loop Hello - I'm a total newbie to html and javascript but have been forced to learn it somewhat since I'm making a website for my wife's business. Anyway, the site has a page where people can choose from menuitems of a form ("select" elements). That form info is then used to call Foxycart. I've decided to link the choosing of those menu-items to showing appropriate product images, thus providing visual feedback for the buyer. I have hacked my way to a point that the page does what I want in Firefox, but it breaks in IE and I have no idea why since the same sort of simple code algorithm to poll the menus with "document.getElementByIdworks" works in IE until I leave the page, but then stops working when I return. The page is he http://angelatoyarn.squarespace.com/...our-own-gelato (the site is still a WIP obviously) In Firefox everything is fine - I can select the items I want and the pictures of those images appear at the bottom of the page. If I leave the page and come back, the function Updateyarn() is called which grabs the .selectedindex values and re-inserts the images. But in IE when I leave the page and come back the select-menus retain their previous values (as they should) but my update yarn () function errors out and doesn't return a valid integer. Please Help! I have no Earthly clue why the IE version is breaking. -thanks, - TJ hi folks extreme newbie here when it comes to javascript. I have an assignment that in which ive created the html+css for the webpage (a pizza form validation basically). and Now I must do the javascript aspect of it. Unfortunately I have no idea how to even begin i dont understand how to use any of these .toUpperCase() .toLowerCase(), how to use window.open for errors instead of alert and all these other things. the way i'm coding it, is with an external file called script.js that will have all my coding and then i have my index.html file...i dont know how to 'call' (if thats the right term) the function to the index.html...or even make jscript code either lol. as an example of a requirement: Code: field01 - Client Surname- Maximum allowable length is 15 positions Must be present. Minimum of four (4) alphabetic characters lower case (a-z) or upper case (A-Z) or a mix of lower & upper case. Optional special characters Optional one (1) apostrophe if present - must have at least 1 alphabetic character before it and one alphabetic character after it. Optional one (1) hyphen if present - must have at least 1 alphabetic character before it and one alphabetic character after it. this is my assignment requirements for those need a better understanding of what's going on https://cs.senecac.on.ca/~int222/***...assignment3-2/ my request is if there is anyone who can lead me in the direction to a website or downloadable book on how to do what it's asking (in no way am i asking someone to do my assignment for me). My professor has his website that has all these predefined things (im assuming are functions) that should be used but i dont understand it nor do i understand him. Any help would be immensely appreciated, thank you. For some reason, can't get my script to load with he page. not sure what I'm doing wrong, but I'm so confused. http://www.rutholsonphoto.com/build-002/index.html Hi peeps, I'm trying to replicate this navigation effect I found when looking through a website design gallery: http://www.nissanusa.com/leaf-electr...ing-experience To be honest, I'm not sure where to start - I've tried searching for this but can't seem to find any plugins like it. Would appreciate any help I can get on this! Thanks in advance! I get "Microsoft JScript runtime error: '$' is undefined" with the javascript below. How should I troubleshoot this? <script type="text/javascript" language="javascript"> function ShowPopup() { $('#mask').show(); $('#<%=pnlpopup.ClientID %>').show(); } function HidePopup() { $('#mask').hide(); $('#<%=pnlpopup.ClientID %>').hide(); } $(".btnClose").live('click', function () { HidePopup(); }); </script> I am trying to run a stored proc from my page using JScript and I am stuck on this error: Quote: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or Function 'AD_AdminInsert2' expects parameter '@CourseID', which was not supplied. The param @CourseID is requested in the stored proc but I don't know why it is not finding it from the following code: Code: cmdAdminInsert = Server.CreateObject("ADODB.Command"); cmdAdminInsert.ActiveConnection = connStringforTest; cmdAdminInsert.CommandText = "dbo.AD_AdminInsert2"; cmdAdminInsert.CommandType = adCmdStoredProc; cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("RETURN_VALUE", adInteger, adParamReturnValue)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@CallerAdminID", adInteger, adParamInput, 1709)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@CourseID", adInteger, adParamInput, 65)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@AdminID", adInteger, adParamOutput)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@OutputResult", adVarChar, adParamOutput, 255)); cmdAdminInsert.Execute(); cmdAdminInsert.ActiveConnection.Close(); An insight or links would be appreciated. Thanks, JJ I have encountered unpleasant thing. Code: var htmlfile = new ActiveXObject('htmlfile'); var window = htmlfile.parentWindow; var document = window.document; var tag = document.createElement('textarea'); tag.innerHTML = 'any non-empty string'; The example above in JScript environment throws the following exception Quote: htmlfile: Catastrophic failure Any script (JS or VBS) is down when assign the 'innerHTML' property of tags. In these examples I create the TEXTAREA tag but it does not matter. This don't work for ALL block or inline tags. Nevertheless an assignment of the 'innerHTML' property in browsers works fine (see the second example). Code: var tag = document.createElement('textarea'); tag.innerHTML = 'any non-empty string'; I have a question. Is this known bug or feature of the 'htmlfile' object? Or maybe someone of you has encountered this? I have been trying for several days now to append a text caption to a displayed image using Javascript, but with no real success. Perhaps JS is not the best way. Has anyone a suggestion as to the best way to tackle this. I want to replace the image captions with text ones to help speed up the site. It is my home site here. A modification of the existing code seems obvious, but I have been unable to do this. Any help gratefully received. Frank The code is JScript .NET, which is basically a .NET version of Javascript. Regardless of language, Anyone with appending type of skill can answer my question. The problem is, when I keep issuing the request it keeps appending over and over again Code: if (oSession.uriContains("search?q=")) { var str = oSession.fullUrl; var sAppend = "+test1+test2+test3"; if (!oSession.uriContains(sAppend)) { oSession.fullUrl = str.replace( "search?q=","search?q="+sAppend); } } Can you please give me an example? I'm still new to programming. Thank you I have a simple play js button on my HTML page as well as embedded music. So when you are a computer the music autoplays then stops and you have the option to listen to it again with the js button. This "theoretically" will work fine for the iPhone and iPad because even though the embedded music isn't auto playing the user can still click the listen button and hear the music. It works on the iPhone perfectly but not the iPad. I'm at a loss. Here is my jscript: function FFFFSound(soundobj) { var thissound= eval("document."+soundobj); thissound.Play(); } My embedded music: <embed src="music/FFFFKids.mp3" autostart="true" loop="false" hidden="true"> <embed src="music/FFFFKids.mp3" autostart="false" loop="false" hidden="true" name="sound1"> And my button: <input type="button" value="Listen" onClick="FFFFSound('sound1')" class="listen_button"> You can view the page at feefifofun.com I am at a total loss..... thanks! I have an app in which a CSS file is being imported with: [code] <style type="text/css" media="all" title="xyz">@import url(assets/css/xyz.css);</style> [/code I have the following function defined: Code: function SetDisplayCSS() { var mysheet=document.styleSheets[0]; var myrules=mysheet.cssRules? mysheet.cssRules: mysheet.rules; alert(mysheet.cssRules); alert(mysheet.rules); alert(mysheet.title); for (i=0; i<myrules.length; i++){ if(myrules[i].selectorText.toLowerCase()=="primarynav"){ //find "a:hover" rule targetrule=myrules[i]; break; } } alert(targetrule); } </script> myrules.length is coming back as 0, even though there are rules defined in xyz.css. Can anyone offer any solutions as to why it's as if no rules are in the css file - is this an issue with @import?? Thanks in advance for any help. Craig Hi, I'm trying to use a form which is existent on one of my sites and try re-creating a similar form on another site for the exact same purpose. Here is the URL for the form on our website Cast Iron Cookware Depot. I have everything duplicated but running into form validation errors. Right now without event entering any data into the form and also the verification code the form still gets submitted but ofcourse runs into "object expected" error at onsubmit="return validate(this);"> by IE Debugger. Below is the total code and would appreciate if any of you gurus point out where the mistake is and also why the exact same code is working on one site is not working on this site. Thanks much in advance. Please help me! ------------------------------------------------------------------------ Code: <style> .TableBG { background-color: #83a338; color: #ffffff; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } .no { font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #333333; width: 35px; text-align:right; } input, textarea {border: 1px inset #cccccc; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;} .input01 {width: 150px;} .input02 {width: 250px;} .button { background-color: #83a338; color: #000000; border: 1px outset #83a338; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } </style><br /> <br /> <table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF" class="TableBG"> <tr> <td bgcolor="#FFFFFF"> <FORM name="form1" method="POST" action="http://s.p8.hostingprod.com/@castironcookwaredepot.com/php/tellafriend.php" onsubmit="return validate(this);"> <FORM name="form1" method="POST" action="http://s.p4.hostingprod.com/@bestsafetyapparel.com/php/tellafriend.php" onsubmit="return validate(this);"> <table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td class="TableBG"> </td> <td class="TableBG"><strong>Your Name: </strong></td> <td class="TableBG"><strong>Your Email: </strong></td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td> </td> <td> <input type="text" name="sName" class="input01" style="font-weight: bold;" /> </td> <td> <input type="text" name="sEmail" class="input02" size="40" style="font-weight: bold;" /> </td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td width="4%" class="TableBG"> </td> <td width="36%" class="TableBG"> Your Friend's Name :</td> <td width="60%" class="TableBG">Your Friend's Email:</td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td class="no"><strong>1.</strong></td> <td> <input type="text" name="name1" class="input01" /> </td> <td> <input type="text" name="email1" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>2.</strong></td> <td> <input type="text" name="name2" class="input01" /> </td> <td> <input type="text" name="email2" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>3.</strong></td> <td> <input type="text" name="name3" class="input01" /> </td> <td> <input type="text" name="email3" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>4.</strong></td> <td> <input type="text" name="name4" class="input01" /> </td> <td> <input type="text" name="email4" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>5.</strong></td> <td> <input type="text" name="name5" class="input01" /> </td> <td> <input type="text" name="email5" class="input02" size="40" /> </td> </tr> <tr> <td class="TableBG"> </td> <td colspan="2" class="TableBG">Your Message </td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td colspan="3" align="center"> <textarea name="comments" cols="65" rows="5" id="comments" style="width: 420px;"></textarea> </td> </tr> <tr> <td class="TableBG"> </td> <td colspan="3" class="TableBG">Enter Verification Code</td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td colspan="3" align="center" valign="absmiddle"><img src="http://s.p8.hostingprod.com/@castironcookwaredepot.com/php/captcha.php" align="absmiddle"> <input type="text" name="vercode" value="Enter Verification Code" onFocus="if(this.value=='Enter Verification Code') this.value='';" onBlur="if(this.value=='') this.value='Enter Verification Code';" size="25"/></td> </tr> <tr> <td colspan="3" align="center"> <input type="submit" name="Submit" value=" Send Email " class="button" /> </td> </tr> </table> </form> </td> </tr> </table> <script> function validate(frm) { name = frm.sName; email = frm.sEmail; name1=frm.name1; email1=frm.email1; err_flag = 0; if (name.value == "" || !removeSpaces(name.value)) { alert ("Please enter proper Name!"); name.value=""; name.focus(); return false; } else if (email.value == "" || !validate_email(email.value)) { alert ("Please enter proper Email!"); email.value=""; email.focus(); return false; } else if (name1.value == "" || !removeSpaces(name1.value)) { alert ("Please enter proper Friend\'s Name!"); name1.value=""; name1.focus(); return false; } else if (email1.value == "" || !validate_email(email1.value)) { alert ("Please enter proper Friend\'s Email!"); email1.value=""; email1.focus(); return false; } } function validate_email(e) { var str=e; var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i if (!filter.test(str)) return false; else return true; } function removeSpaces(string) { var tstring = ""; string = '' + string; splitstring = string.split(" "); for(i = 0; i < splitstring.length; i++) tstring += splitstring[i]; return tstring; } </script> <br /> <br /> Regards Learner 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! |