JavaScript - Javascript Question
Hey Guys,
I was creating an image map with rollover images. I was just wondering if I could add a fade effect to the transition. The underarms is the only rollover that works at the moment. Please check the source code for the code because it's too long to post here. http://wedezign.com/chris/ Similar TutorialsI am a newbie with a newbie question =) I recently took an exam type thing using my Firefox browser (v3.5.3). I still have my browser window open that I used, and when I press the back button on the browser I get a message "To display this page, Firefox must send information that will repeat any action ..." Is there any way (either disk or memory cache) to reload the pages with out having to resend the data, OR is there any way (hex editor) to view the exam (forms) questions?? Just curious, Thanks I have a question about Javascript. Hello. I need help with JavaScript enabled. My job so that I can automatically send button to be pushed faster. I use google chrome. For example; Automatically have form filling add-ons. (Autofill), but only to fill the send button will not print. How can I do this automatically? Button codes; <input type='submit' name='post_shout' value='Shout' class='button' /> Google Chrome address bar: javascript: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx what I need to write here? Can I do it after 1-2 seconds and fill out? Many thanks in advance. (My English is poor) So erm. Hello there. I fail at javascript, and yet, I'm trying it. Anyways, I'm working on this thing. It's an extension for google chrome very similar to firefox plugins and so on. I'm making an extension so that, when installed, it changes the look of facebook completely. I have successfully changed the colors. However, I am having some trouble getting my javascript to change images. If anybody out there has some insight on what I'm doing wrong, I am glad to accept any kind of help that anyone is willing to give me, lol. What I've done so far: I have to change the facebook logo (what I'm trying to do now) and then change the links, and very few more things, and I'm done. Problem: I can't figure out how to change the image. I can change the background color, as you saw earlier. I just need a code to change the image. The CSS behind it is: Code: #pageLogo a{background:#3b5998 url(/rsrc.php/z8S5R/hash/ez3x5cuc.png) no-repeat -21px 0;display:block;position:absolute;height:31px;left:-6px;width:103px;top:10px} and the HTML implementing it is: Code: <h1 id="pageLogo"><a href="http://www.facebook.com/?ref=logo" title="Home" accesskey="1"></a></h1> and my structure of javascript is: Code: for(i=0;i<=document.getElementsByTagName("div").length;i++) { if(document.getElementsByTagName("div")[i].id != null) { if((document.getElementsByTagName("div")[i].id=="blueBar")) { document.getElementsByTagName("div")[i].style.backgroundColor='#B22222'; } if(( document.getElementsByTagName("div")[i].id == "headNavOut")) { document.getElementsByTagName("div")[i].style.backgroundColor='#8B0000'; } } } }); I appreciate any help anyone's willing to give. I think this is a pretty easy to fix error made by a newb ( me. Can anyone tell me why the call to "this.slideNext() " in the code below does not work. Apparently "this.slideNext() " is not a function? Code: function ScoopAnimation(_path, _start, _end, _delay){ this.start = _start this.end = _end; this.delay = _delay; this.path = _path this.currentFrame = _start; this.slideNext() = function (){ this.currentFrame ++; console.log(' next this.currentFrame : ' +this.currentFrame ); } this.start= function () { console.log('next this.start() : ' +this.currentFrame ); //THE NEXT LINE CAUSES THE ERROR! this.slideNext() } this.start(); } HI Guys!! My name is Megan and I am a college student in need of some JavaScript help for my computer science class!! My professor is making us complete some stupid class project for finals and I can't figure it out! He suggested that we may try to find a JavaScript Website to help us if we have trouble figuring out how to write the code. I have looked and looked and can't find out how to fix my code!! We have to write code to make a slot machine .. I have started the code based on what he gave us and have tried my hardest to figure out how to complete it but I do not know how to finish it. I have the images working correctly (kind of.. the second one seems to have problems loading? I dunno what I did to mess that up) and the counter working, but I need to make it add 13 credits when all 3 images are the same. I added code that I thought would work but it's not for some reason that I can't figure out. It should also pop up an alert screen when all 3 are correct and you win. I guess this would have to be including with the if statement and something like alert('You win 12 credits!!!') Lastly I need to add code that prevents the person from playing when the credit line is 0 (so you can't get - credits!) and I have no idea how to do this. Any help would be greatly appreciated! Here's what I have so far! HI Guys!! My name is Megan and I am a college student in need of some JavaScript help for my computer science class!! My professor is making us complete some stupid class project for finals and I can't figure it out! He suggested that we may try to find a JavaScript Website to help us if we have trouble figuring out how to write the code. I have looked and looked and can't find out how to fix my code!! We have to write code to make a slot machine .. I have started the code based on what he gave us and have tried my hardest to figure out how to complete it but I do not know how to finish it. I have the images working correctly (kind of.. the second one seems to have problems loading? I dunno what I did to mess that up) and the counter working, but I need to make it add 13 credits when all 3 images are the same. I added code that I thought would work but it's not for some reason that I can't figure out. It should also pop up an alert screen when all 3 are correct and you win. I guess this would have to be including with the if statement and something like alert('You win 12 credits!!!') Lastly I need to add code that prevents the person from playing when the credit line is 0 (so you can't get - credits!) and I have no idea how to do this. Any help would be greatly appreciated! Here's what I have so far! Code: <html> <head> <title> Slot Machine</title> <script type="text/javascript" src="http://balance3e.com/random.js"></script> <script type="text/javascript"> function SpinSlots() // Assumes: slot images are in http://balance3e.com/Images // Resultes: displays 3 random slot images { var slot1, slot2, slot3; slot1 = RandomOneOf(['lemon', 'cherry', 'bar']); slot2 = RandomOneOf(['lemon', 'cherry', 'bar']); slot3 = RandomOneOf(['lemon', 'cherry', 'bar']); document.getElementById('slot1Img').src = 'http://balance3e.com/Images/' + slot1 + '.jpg'; document.getElementById('slot2Img').src = 'http://balance3e.com/Images/' + slot2 + '.jgp'; document.getElementById('slot3Img').src = 'http://balance3e.com/Images/' + slot3 + '.jpg'; document.getElementById('credits').innerHTML = parseFloat(document.getElementById('credits').innerHTML) - 1; if (slot1 == slot2 == slot3) { document.getElementById('credits').innerHTML = parseFloat(document.getElementById('credits').innerHTML) + 13; } } </script> </head> <body> <div style="text-align:center"> <p> <img id="slot1Img" border=1 alt="slot image" src="http://balance3e.com/Images/cherry.jpg"> <img id="slot2Img" border=1 alt="slot image" src="http://balance3e.com/Images/lemon.jpg"> <img id="slot3Img" border=1 alt="slot image" src="http://balance3e.com/Images/bar.jpg"> </p> <input type="button" value="Click to Spin" onclick="SpinSlots();"> <p> Credits Remaining: <spin id="credits">20</span> </p> </div> </body> </html> I'm trying to figure out this question that was assigned to me, as I haven't done alot on javascript before but I've tried to get most of this, I'm just not sure if this is correct. If anybody could help it would be greatly appreciated. The question is as follows: You are provided with a string array called country that contains the name of every country that the Ski Club visits. For example one element of this array might be as follows: country[0] = "Austria" Another array called villages contains strings with information on village names and altitude in a particular country. For example: villages[0] = "Austria:Seefield 850m*"; Write a JavaScript function snowReport(countryIndex) that will use the arrays provided to write a report of all villages that include a given country. The function will be passed an integer representing the index of an element of the country array. A match is found if the country appears in a string (Hint use appropriate JavaScript function to evaluate if a country name is contained in a village string.) All matching villages should be displayed. Output should be displayed in the villages div element you defined in part (a). Output is shown for a search for Austria in Figure 1b. <script type="text/javascript"> function makeArray() { var country = new Array(5); country[0] = "Austria"; country[1] = "Canada"; country[2] = "France"; country[3] = "Germany"; country[4] = "Switzerland"; return country; var villages = new Array(2); villages[0] = "Austria:Seefield 850m*"; villages[1] = "Austria:Ellam 100m"; return villages; } function snowReport(countryIndex){ var string = ""; for (var i = 0; i < countryIndex.length; i++){ str += countryIndex[i] + " "; } return str; } </script> </head> <body> <script> var x = makeArray(); document.write(snowReport(x)); </script> </body> </html> Many thanks! I have an application that has a menu - one of the choices on that menu is "Contacts" - This menu is controlled by css - I've written a script that will modify the css style setting for "display" and "zindex" for the rule that controls the pull down for contacts - this worked for hover, but I am now trying to change to a click event - I successfully change the rule, but the menu doesn't display - not sure if I'm returning incorrectly form the javascript function or what - here's a code snippet: CSS: Code: .primaryNav .subMenu { background-color: #B0967E; position: absolute; width: 300px; left: 600px; /* 823px - 300px - 20 px + 97px */ padding: 10px; display: none; color: #fff; font-size: 90%; } Javascript: Code: <script type="text/javascript"> function SetDisplayCSS() { var mysheet=document.styleSheets[0]; var myrules=mysheet.cssRules? mysheet.cssRules[0].styleSheet.cssRules: mysheet.imports[0].rules; for (i=0; i<myrules.length; i++){ if(myrules[i].selectorText.toLowerCase()==".primarynav .submenu"){ //find "a:hover" rule targetrule=myrules[i]; alert("Rule is found"); break; } } targetrule.style.display = "block"; targetrule.style.zindex = "10"; alert(targetrule.selectorText); alert(targetrule.style.backgroundColor); alert(targetrule.style.position); alert(targetrule.style.width); alert(targetrule.style.left); alert(targetrule.style.padding); alert(targetrule.style.display); alert(targetrule.style.color); alert(targetrule.style.fontSize); alert(targetrule.style.zindex); return true; } </script> html Code (names have been changed to protect the innocent) - note the onclick event handler for the contacts menu option. Code: <li class="pn test"><a href="#" onclick="return SetDisplayCSS();" name="contacts">Contacts</a> <div class="subMenu"> <table width="100%"> <tbody> <col /> <col align="right" valign="top" /> <tr> <td><a href="mailto:abc@xxxxxxx.com">Service Requests</a></td> <td>555.555.5555</td> </tr> <tr> <td><a href="mailto:me@notreal.com">Bugs Bunny</a><br />Tenant Liaison</td> <td>555.555.555</td> </tr> <tr> <td><a href="mailto:blah@blah.com">blah blah</a><br />Client Services Manager</td> <td>123.456.1234</td> </tr> </tbody> </table> <p><a href="xxxxxxxx.htm" class="more">More Contacts...</a></p> </div> </li> Thanks for any help...... I'm not really looking for someone to fix/answer this for me, but maybe give me a hit in the right direction. I need to fix this while loop to run correctly, but has errors in the code. This code is supposed to fill an array with numbers 1 through 100 and then print them. Here is the code: <script type="text/javascript"> /* <![CDATA[ */ var count = 0; var numbers = new Array(100); while (count < 100) { numbers[count] = count; ++count; } while (count < 100 ) { document.write(numbers[count]); ++count; } /* ]]> */ </script> What i am most confused about is this part of the code numbers[count] i don't understand what is going on there. Sorry i am very new to this. Any ideas would be appreciated thank you. Hello to everyone, I got a bit of a situation here, I wrote this code that basicaly what it does is, gets code from input field, sends it to php file get the results back and also calls the second php page to chage the prices but kill me I cant figure out what I did wrong Can anyone help? Here is the code: <div style = "position: relative; width: 100%; height: 100%;" id = "idCouponRequest"> <table width="100%" border="0" cellspacing="4" cellpadding="4" id = "tblCoupon"> <tr> <td class="detHeadTxt" align="right" valign="middle">Enter Your Coupon:</td> <td width="165" align="center" valign="middle"><input id = "edtCoupon" type="text" name="coupon" size="32" maxlength="15"></td> <td width="175" align="right" valign="middle"><INPUT type="image" name="coupon" src="images/redeem.gif" class = "mnCurs" border="0" onclick = "javascriptostCheckout();"></td> </tr> </table> </div> <script language = "javascript"> var couponCode; function postCheckout() { getContent('includes/checkout/processCoupon.php', 'coupon_code=' + document.getElementById('edtCoupon').value, function () { couponCode = document.getElementById('edtCoupon').value; var win = document.getElementById('idCouponRequest'); win.innerHTML = '<table border = 0 width = 100% height = 100%><tr><td align = center valign = center class = \"detCartHead\">Processing Coupon...</td></tr><tr><td align = center valign = center><img src="images/rating_loading.gif" alt="loading" /></td></tr></table>'; }, function () { if (xmlHttp.readyState != 4) return; var res = xmlHttp.responseText; var win = document.getElementById('idCouponRequest'); win.innerHTML = res; refreshOrderSumm(); }); } function refreshOrderSumm() { getContent('includes/checkout/processOrderSumm.php', 'coupon_code=' + couponCode, function () { var win = document.getElementById('divSummLoading'); win.style.display = ''; }, function () { if (xmlHttp.readyState != 4) return; var res = xmlHttp.responseText; var win = document.getElementById('divSummLoading'); win.style.display = 'none'; var win = document.getElementById('divCouponSumm'); win.innerHTML = res; }); } </script> I was wondering if it was possible to get java to display images that have the same name but diff numbers like: Soccer*** Displays; Soccer001 Soccer002 Soccer003 Soccer004 .... So on and so forth. Sorry the question isn't worded well lol Hello guys, Im new to Javascript,please help me ya in my php code, I retrieve a ID value and assign to variable like below PHP Code: $id = $gettingdata['id']; and I want this id to be include together with javascript "insertsubcat" function like below Code: <a href="javascript:insertsubcat('.$ID.');"/>Click to insert this data</a> in the javascript page, I dont know how to call back the id value and i try like code below but it doesnt work Code: function insertsubcat(data) { var data = data.value; . . . . } Any idea? Thanks Azhan Malaysia I currently have a JavaScript function that works great except for what I am about to explain and wish that i can get it worked out by utilizing someones help in this forum. So, Here goes. I have 2 list boxes one that has a list of options and one empty. when I click the button between the two It places the values into the other box and vice versa which currently works fine. The thing is when I click the submit button to store that info from the list box to the empty box in a DB it does not record the value's as if the box was empty after I have already selected from the list. is there anyone that can help me in figuring this thing out, I would greatly appreciate it. Here is my code: JavaScript Code: <script language="javascript"> function validate_list() { if ( document.theForm.ToLB.value == "" ) { alert ( "Please select header column from the list box. " ); return false; }else return true; } function move(tbFrom, tbTo) { var arrFrom = new Array(); var arrTo = new Array(); var arrLU = new Array(); var i; for (i = 0; i < tbTo.options.length; i++) { arrLU[tbTo.options[i].text] = tbTo.options[i].value; arrTo[i] = tbTo.options[i].text; } var fLength = 0; var tLength = arrTo.length; for(i = 0; i < tbFrom.options.length; i++) { arrLU[tbFrom.options[i].text] = tbFrom.options[i].value; if (tbFrom.options[i].selected && tbFrom.options[i].value != "") { arrTo[tLength] = tbFrom.options[i].text; tLength++; } else { arrFrom[fLength] = tbFrom.options[i].text; fLength++; } } tbFrom.length = 0; tbTo.length = 0; var ii; for(ii = 0; ii < arrFrom.length; ii++) { var no = new Option(); no.value = arrLU[arrFrom[ii]]; no.text = arrFrom[ii]; tbFrom[ii] = no; } for(ii = 0; ii < arrTo.length; ii++) { var no = new Option(); no.value = arrLU[arrTo[ii]]; no.text = arrTo[ii]; tbTo[ii] = no; } } </script> Html Code: <table width="250" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100"> <select name="FromLB" size="26" style="width:200px" id="sourceSelect" multiple="multiple" ondblclick="move(this.form.FromLB,this.form.ToLB)"> <option value="Contract ID">Contract ID</option> <option value="Vendor ID">Vendor ID</option> <option value="Complete Upon Initial Receipt">Complete Upon Initial Receipt</option> <option value="Contract Complete">Contract Complete</option> <option value="Customer has Renewed">Customer has Renewed</option> <option value="Date Recieved">Date Recieved</option> <option value="Do Not Renew">Do Not Renew</option> <option value="Evergreen Clause">Evergreen Clause</option> <option value="GLB Compliant">GLB Compliant</option> <option value="GLB Sensitive">GLB Sensitive</option> <option value="Red Flag Sensitive">Red Flag Sensitive</option> <option value="Red Flag Compliant">Red Flag Compliant</option> <option value="Indefinite">Indefinite</option> <option value="Initial Termination">Initial Termination</option> <option value="Last File Upload">Last File Upload</option> <option value="M/N/A">M/N/A</option> <option value="Notice Date">Notice Date</option> <option value="Renewal Terms">Renewal Terms</option> <option value="Override Termination Date">Override Termination Date</option> <option value="Termination Date">Termination Date</option> <option value="Termination Letter Sent">Termination Letter Sent</option> <option value="Effective Date">Effective Date</option> <option value="Client">Client</option> <option value="Vendor">Vendor</option> <option value="Contract Completed Date">Contract Completed Date</option> <option value="Customer Desc">Customer Desc</option> </select> </td> <td width="100" align="center" valign="middle"> <input type="button" name="forward" id="button" style="width:95px" value="Add>>" onClick="move(this.form.FromLB,this.form.ToLB)"/> <br> <br> <input type="button" name="back" id="button" style="width:95px" value="<<Remove" onClick="move(this.form.ToLB,this.form.FromLB)"/> </td> <td align="left"> <select name="ToLB" id="ToLb" size="26" style="width:200px" multiple="multiple" ondblclick="move(this.form.ToLB,this.form.FromLB)"/> </select> </td> </tr> </table> Here is my webpage (don't laugh!). If you click on Espanol it translates the page to Spanish. English is set up differently and it works too. Please tell me why clicking Spanish works but not French, Portuguese, etc. Code: <body> <p align="center"> <b id='Spanish1'><b id='French1'><b id='Portuguese1'><b id='German1'><b id='Danish1'><b id='Dutch1'><b id='Finnish1'><b id='Swedish1'><b id='Norwegian1'></b>Change Language:</b></b></b></b></b></b></b></b> <input type='button' onclick='TranslateToSpanish()' value='Espanol' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToFrench()' value='Francais' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToPortuguese()' value='Portuguese' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToGerman()' value='Deutsch' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToDanish()' value='Dansk' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToDutch()' value='Nederlands' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToFinnish()' value='Suomi' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToSwedish()' value='Svensk' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type='button' onclick='TranslateToNorwegian()' value='Norske' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <a href='http://www.luxe-bux.com/the-link-of-the-same-page-viewer-is-on-so-it-will-refresh-the-page-back-to-english'><input type='button' value='English' style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"></a> <div class="header" onclick="location.href='http://www.luxe-bux.com';" style="cursor: pointer"> <img src="http://i770.photobucket.com/albums/xx344/colorscolors123/0546d64a.png"> Luxe Bux <font size="2"><b id='Spanish2'><b id='French2'><b id='Portuguese2'><b id='German2'><b id='Danish2'><b id='Dutch2'><b id='Finnish2'><b id='Swedish2'><b id='Norwegian2'></b>Luxuries For Less!</b></b></b></b></b></b></b></b></b><br>.</font></div> <div class="test"> <div class="allthestuff"> <h1><!-- Atomz HTML for Search --> <form method="get" action="http://search.atomz.com/search/" rel="nofollow" target="foo" onSubmit="window.open('', 'foo', 'width=1200,height=500,status=yes,resizable=yes,scrollbars=yes')"> <input type="hidden" name="sp_a" value="sp1004432f"> <p align="center"><font color=ffffff size=3><b id='Spanish3'><b id='French3'><b id='Portuguese3'><b id='German3'><b id='Danish3'><b id='Dutch3'><b id='Finnish3'><b id='Swedish3'><b id='Norwegian3'>Search Luxe Bux:</b></b></b></b></b></b></b></b></b></font> <input size="30" name="sp_q" style="background-color: #cb672d; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011"> <input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Find it!"><b id='Spanish4'></b><b id='French4'></b> <input type="hidden" name="sp_p" value="all"> <input type="hidden" name="sp_f" value="UTF-8"></p> </form> </h1> <div class="container"> <ul> <li><a class="nav" href="http://www.luxe-bux.com"><b class="ShopNow"><b id='Spanish5'><b id='French5'><b id='Portuguese5'><b id='German5'><b id='Danish5'><b id='Dutch5'><b id='Finnish5'><b id='Swedish5'><b id='Norwegian5'>Shop Now!</b></b></b></b></b></b></b></b></b></b></a></li> <li><a class="nav" href="http://www.luxe-bux.com"><b id='Spanish6'><b id='French6'><b id='Portuguese6'><b id='German6'><b id='Danish6'><b id='Dutch6'><b id='Finnish6'><b id='Swedish6'><b id='Norwegian6'>Reviews of Luxe Bux</b></b></b></b></b></b></b></b></b></a></li> <li><a class="nav" href="http://www.luxe-bux.com"><b id='Spanish7'><b id='French7'><b id='Portuguese7'><b id='German7'><b id='Danish7'><b id='Dutch7'><b id='Finnish7'><b id='Swedish7'><b id='Norwegian7'>FAQ/Return Policy/More Info</b></b></b></b></b></b></b></b></b></a></li> <li><a class="nav" href="http://www.luxe-bux.com"><b id='Spanish8'><b id='French8'><b id='Portuguese8'><b id='German8'><b id='Danish8'><b id='Dutch8'><b id='Finnish8'><b id='Swedish8'><b id='Norwegian8'>Contact</b></b></b></b></b></b></b></b></b></a></li> </ul> </div> <br> <div class="IdeaColor"> <div class="marginspacer"> <p><img alt="small-euro-currency-sign.jpg" style="padding: 15px; border: 2px solid #000000;" src="http://www.luxebux.com/sitebuildercontent/sitebuilderpictures/.pond/desaturated-and-resized-only.jpg.w180h269.jpg" align="right" vspace="0" hspace="5"></p> <p> <b id='Spanish9'><b id='French9'><b id='Portuguese9'><b id='German9'><b id='Danish9'><b id='Dutch9'><b id='Finnish9'><b id='Swedish9'><b id='Norwegian9'> <font size="4">Here's what our customers are saying...<br><br></font><br /><font size="3"> "THANK YOU VERY MUCH NICE DEALING WITH"<br> "Exceptional service overall and great care in packaging! I will buy again! A++"<br> "Exactly as advertised! Fast shipping(always takes longer to Canada) A+" <br> "great online sellers. highly recomended! will buy from again"<br> "Arrived in record time and packaged well. Thanks"<br> "Quick"<br> "Great service, very fast shipping. I will definitely buy from them again"<br> "Arrived quickly as described!!"<br><br><br><br><br><br></p> </b></b></b></b></b></b></b></b></b> </div></div> <table height="100"><tr><td></td></tr></table> <table width=100% height=20px bgcolor="#f5e9c3"> <tr><td></td></tr> </table> <script type="text/javascript"> function TranslateToSpanish() { document.getElementById('Spanish1').innerHTML = 'Lengua del cambio:'; document.getElementById('Spanish2').innerHTML = 'Lujos para menos!'; document.getElementById('Spanish3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('Spanish4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('Spanish5').innerHTML = 'Tienda ahora!'; document.getElementById('Spanish6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('Spanish7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('Spanish8').innerHTML = 'Contacto'; document.getElementById('Spanish9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p>'; } </script> <script type="text/javascript"> function TranslateToFrench() { document.getElementById('French1').innerHTML = 'Lengua del cambio:'; document.getElementById('French2').innerHTML = 'Lujos para menos!'; document.getElementById('French3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('French4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('French5').innerHTML = 'Tienda ahora!'; document.getElementById('French6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('French7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('French8').innerHTML = 'Contacto'; document.getElementById('French9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> <script type="text/javascript"> function TranslateToPortuguese() { document.getElementById('Portuguese1').innerHTML = 'Lengua del cambio:'; document.getElementById('Portuguese2').innerHTML = 'Lujos para menos!'; document.getElementById('Portuguese3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('Portuguese4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('Portuguese5').innerHTML = 'Tienda ahora!'; document.getElementById('Portuguese6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('Portuguese7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('Portuguese8').innerHTML = 'Contacto'; document.getElementById('Portuguese9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> <script type="text/javascript"> function TranslateToGerman() { document.getElementById('German1').innerHTML = 'Lengua del cambio:'; document.getElementById('German2').innerHTML = 'Lujos para menos!'; document.getElementById('German3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('German4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('German5').innerHTML = 'Tienda ahora!'; document.getElementById('German6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('German7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('German8').innerHTML = 'Contacto'; document.getElementById('German9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> <script type="text/javascript"> function TranslateToDanish() { document.getElementById('Danish1').innerHTML = 'Lengua del cambio:'; document.getElementById('Danish2').innerHTML = 'Lujos para menos!'; document.getElementById('Danish3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('Danish4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('Danish5').innerHTML = 'Tienda ahora!'; document.getElementById('Danish6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('Danish7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('Danish8').innerHTML = 'Contacto'; document.getElementById('Danish9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> <script type="text/javascript"> function TranslateToDutch() { document.getElementById('Dutch1').innerHTML = 'Lengua del cambio:'; document.getElementById('Dutch2').innerHTML = 'Lujos para menos!'; document.getElementById('Dutch3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('Dutch4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('Dutch5').innerHTML = 'Tienda ahora!'; document.getElementById('Dutch6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('Dutch7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('Dutch8').innerHTML = 'Contacto'; document.getElementById('Dutch9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> <script type="text/javascript"> function TranslateToFinnish() { document.getElementById('Finnish1').innerHTML = 'Lengua del cambio:'; document.getElementById('Finnish2').innerHTML = 'Lujos para menos!'; document.getElementById('Finnish3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('Finnish4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('Finnish5').innerHTML = 'Tienda ahora!'; document.getElementById('Finnish6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('Finnish7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('Finnish8').innerHTML = 'Contacto'; document.getElementById('Finnish9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> <script type="text/javascript"> function TranslateToSwedish() { document.getElementById('Swedish1').innerHTML = 'Lengua del cambio:'; document.getElementById('Swedish2').innerHTML = 'Lujos para menos!'; document.getElementById('Swedish3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('Swedish4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('Swedish5').innerHTML = 'Tienda ahora!'; document.getElementById('Swedish6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('Swedish7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('Swedish8').innerHTML = 'Contacto'; document.getElementById('Swedish9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> <script type="text/javascript"> function TranslateToNorwegian() { document.getElementById('Norwegian1').innerHTML = 'Lengua del cambio:'; document.getElementById('Norwegian2').innerHTML = 'Lujos para menos!'; document.getElementById('Norwegian3').innerHTML = 'Busqueda Luxe Bux:'; document.getElementById('Norwegian4').innerHTML = '<input type="submit" style="background-color: #794011; color: #ffffff; border-width: thin; border-style: dotted; border-color: 794011" value="Encuentrelo!">'; document.getElementById('Norwegian5').innerHTML = 'Tienda ahora!'; document.getElementById('Norwegian6').innerHTML = 'Revisiones de Luxe Bux'; document.getElementById('Norwegian7').innerHTML = 'Politica de FAQ/Return/mas Info'; document.getElementById('Norwegian8').innerHTML = 'Contacto'; document.getElementById('Norwegian9').innerHTML = '<font size="4">Aqui es lo que estan diciendo nuestros clientes...<br><br></font><br /><font size="3">"GRACIAS EL TRATAR MUCHO AGRADABLE DE"<br>"Cuidado total y grande del servicio excepcional en el empaquetado! Comprare otra vez!"<br>"Exactamente segun lo anunciado! Envio rapido (lleva siempre mas de largo Canada)"<br>"grandes vendedores en linea. recomendado altamente! comprara de otra vez"<br>"Llegado en tiempo de registro y empaquetado bien. Grazias"<br>"Aprisa"<br>"Gran servicio, envio muy rapido. Comprare definitivamente de ellos otra vez"<br>"Llegado rapidamente segun lo descrito!!"<br><br><br><br><br><br></p> } </script> </body></html> Hi I am developing a timer kind of thing here is my requirement: I have a form which retrieves results from DB. and the form has 2 buttons startcount, stop count with a textbox already filled with time in seconds data from DB.(let us say the text box holds 600 as of now). when the user clicks start count it should start the counting from 601,602,,,goes on until user hits stop button. How can i acheive this...here is my code so far... Code: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> var t; var timer_is_on=0; function timedCount(TestVar) { TestVar =TestVar+1; //document.getElementById('txt').value=c; alert("you typed:"+TestVar); //c=c+1; t=setTimeout("timedCount()",1000); } function doTimer(form) { TestVar = parseInt(form.txt.value); //alert("you typed: " +TestVar); timedCount(TestVar); } function stopCount() { clearTimeout(t); timer_is_on=0; } </script> </head> <body> <form name="test" onsubmit="timedCount()" > <table width="200" border="0"> <tr> <th scope="row"><label> <input type="button" value="Start count!" onclick="doTimer(this.form)" /> </label></th> <td><label> <input type="text" name ="txt" id="txt"/> </label></td> <td><label> <input type="button" name="stop" id="stop" value="Stop" onclick="stopCount(this.form)" /> </label></td> </tr> </table> </form> </body> </html> Thanks in adv.... Hello All Its my first post on this forum. I have a database setup with tables that use my form element names as column names. Now i have successfully retrieved column names and values from the server side to the client side. . I have the column name stored in var columnName How can I get the type of form element type and how can i set the value to it Thanks for your help #Javalove. . .unless otherwise stated. . .! I'm trying to implement a registration form (which I made), but then after pressing submit button I would like to display on the main page using javascript the information I have entered. I'm really weak with javascript, so if some on could point me in the right direction I would appreciate it. (ps. This shouldn't be printed in a alert window) I was going through an article on JavaScript objects on "http://www.howtocreate.co.uk/tutorials/javascript/javascriptobject" and there I read Quote: Intrinsic objects - variable types with constructors. * Array * Boolean * Date * Function * Image * Number * Object * Option * Regular Expression * String does it mean that, whenever I want to use any of these objects, I have to create it using new and only then I can use its properties or methods ? 1) There are other objects like document, history, location, navigator, parent and screen. If objects which need to be created using constructor are called intrinsic objects , then what are other objects which can be used without constructor are called as ? Array, Boolean, Image, Date etc all start with capital letter. While document, history, navigator etc start with lower case letter. Why is that ? Is there any difference between objects that start with upper case and those start with lower case ? Are they known by different names ? Thanks I am very new to this, so I appreciate everyone's help and patience I am displaying information on our company intranet. I want the user to be able to choice if they want to see the information sorted by person or by issue. Because of the way that this is setup, the info is not in a table and cannot be sorted. I want users to be able to view content either way, but with only one option being visible. This would require the OR operator combined with the toggle function (I assume), but I am pretty lost... This toggle below allows me to show/hide one on top of the other, but I want one to replace the other: <SCRIPT type=text/javascript> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </SCRIPT> <P><STRONG><FONT color=#00467f size=3>Primary Contacts</FONT></STRONG></P> <P><A onclick="toggle_visibility('issue');" href="#">Toggle Contacts by Issue</A></P> <P> </P> <DIV style="DISPLAY: none" id=issue>%%Pages.Body PageID="596"%%</DIV> <DIV style="DISPLAY: block" id=pers>%%Pages.Body PageID="595"%%</DIV> Again, I really appreciate the help Hello All, I have a rather complex (well, to me at least, it's complex ) "loop" (not in a programming way, but in a metaphorical way) that I need to close, and, considering that a lot of Javascript (as well as some .php) is involved, I was hoping I could get some help here. My project involves a form that pulls data from an xml file, and then has the user check radio buttons on whether they approve of the information pulled from the xml file. The user then submits the form (that includes their email address), then, a pdf file of the form information, including the xml data AND the radio button and text data, is automatically generated and emailed to the user. The form-to-pdf software I'm using is found at this link: http://coreyworrell.com/blog/article...pdf-attachment the Demo is he http://coreyworrell.com/demos/pdf_email/form.php (Excellent software, by the way. A html form that, upon submission, dynamically creates a pdf file of the form, and then automatically emails that file to whomever you want, including the user? Tooooo cool.) I've set up a sample, below, for what the entire loop needs to do. The first file is the "test.xml" file that includes the sample data: Code: <?xml version="1.0" encoding="UTF-8"?> <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Quotediscrepancy.xsd" generated="2011-01-14T11:03:31"> <XMLtest> <Name>Bob Jones</Name> <Address>123 4th Street</Address> </XMLtest> </dataroot> The second file is the form itself -- sample_form.php -- that pulls the data from the test.xml file, AND includes form elements like radio buttons and text fields: 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> </HEAD> <body> <form action="pdf.php" method="post"> <script type="text/javascript"> if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","test.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; document.write("<table border='1' cellpadding='5'>"); document.write("<tr><td> <b>Customer</b>"); document.write("</td><td> <b>Address </b>"); document.write("</td></tr>"); var x=xmlDoc.getElementsByTagName("XMLtest"); for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x[i].getElementsByTagName("Name")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x[i].getElementsByTagName("Address")[0].childNodes[0].nodeValue); document.write("</td></tr>"); } document.write("</table>"); </script> <br><br> Email: <input type="text" name="email"> <br><br> Yes: <input type="radio" name="radio1" value="Yes"> :: No: <input type="radio" name="radio1" value="No"> <br><br> <p><button type="submit">Click Here to Submit Order</button></p> </form> </body> </html> Here's where I'm stuck. I don't know how to send all of the xml data AND the form data to the next step in the "loop" -- where the pdf file is dynamically created -- a version of the file "pdf.php" in the above-mentioned softwa Code: <html> <head> <style> body {font-family:Helvetica, Arial, sans-serif; font-size:10pt;} table {width:100%; border-collapse:collapse; border:1px solid #CCC;} td {padding:5px; border:1px solid #CCC; border-width:1px 0;} </style> </head> <body> <h1>Form Results</h1> <table> <tr> <td>Name:</td> <td><?php echo $post->name; ?></td> <td>Address:</td> <td><?php echo $post->address; ?></td> <td>Email:</td> <td><?php echo $post->email; ?></td> </tr> <tr> <td>Yes:</td> <td colspan="3"><?php echo $post->yes; ?></td> </tr> <tr> <td>No:</td> <td colspan="3"><?php echo $post->no; ?></td> </tr> </table> </body> </html> Any ideas? MUCH thanks. |