JavaScript - I Need Help In Solving This Javascript Question! Please Help!
I need help in writing the commands that calls the function product 5 times (for loop). function product multiplies two variables (a*b) where a, and b are entered by the user using two prompt boxes and check.
(using if else) a. if the result is greater than 10 return "Greater" b. if the result is even return "Even" in heading 1 style. c. else return "try again" in heading 1 style. Reply With Quote 01-17-2015, 11:37 AM #2 xelawho View Profile View Forum Posts Senior Coder Join Date Nov 2010 Posts 3,043 Thanks 56 Thanked 568 Times in 565 Posts Two questions: - When is your homework due? - What have you done so far? Reply With Quote 01-17-2015, 11:41 AM #3 1x1x1x1 View Profile View Forum Posts New to the CF scene Join Date Jan 2015 Posts 3 Thanks 0 Thanked 0 Times in 0 Posts Originally Posted by xelawho Two questions: - When is your homework due? - What have you done so far? I know how to declare the function and use for loop, I just don't understand how to use if else with return. Reply With Quote 01-17-2015, 11:52 AM #4 1x1x1x1 View Profile View Forum Posts New to the CF scene Join Date Jan 2015 Posts 3 Thanks 0 Thanked 0 Times in 0 Posts This is what I know so far, PLEASE CORRECT ME IF I AM WRONG! <html> <head> <script type=text/javascript> function product(a,b) { return a*b; } </script> </head> <body> <script type=text/js> for(i=0;i<5;i++) { var x=prompt("Enter number") var y=prompt("Enter number") document.write(product(x,y)) please correct me if i am wrong, and please help me with return :/ Reply With Quote 01-17-2015, 12:06 PM #5 TiredPerson View Profile View Forum Posts New to the CF scene Join Date Jan 2015 Posts 7 Thanks 0 Thanked 0 Times in 0 Posts Read about return in Tryit Editor v2.3 One way is to write a <p id="ape"> try again</p> in html and in script write a var which gets the "ape" id from your html. var ape= document.getElementById("ape").innerHTML Code: if(2>1){ return ape; }else if(3==3){ return myOtherVariable; } Reply With Quote 01-17-2015, 12:16 PM #6 xelawho View Profile View Forum Posts Senior Coder Join Date Nov 2010 Posts 3,043 Thanks 56 Thanked 568 Times in 565 Posts Originally Posted by 1x1x1x1 <script type=text/js> I'd be looking at that line first if I were you Reply With Quote 01-19-2015, 05:46 AM #7 Old Pedant View Profile View Forum Posts Supreme Master coder! Join Date Feb 2009 Posts 28,311 Thanks 82 Thanked 4,754 Times in 4,716 Posts And why do you need an return other than what you used already in the product( ) function? (For that matter, why in the world do you need or want the product( ) function???) Similar TutorialsI'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! 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/ 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...... 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(); } 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) 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. I 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 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 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 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 put the jquery script into my subdirectory. In the header which one is correct: Code: <script type="text/javascript" src="../jquery/jquery.js"></script> or Code: <script src="../jquery/jquery.js"></script> And there is this code: do I put this in the body and enclose it with the <script>tag? Code: $(function(){ // set interval for 5 minutes setInterval(function(){ $.ajax({url: "keep-alive.php"}); }, 300000); }); 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. Hi Peers, I am capturing query data into different Javascript arrays and that is the only way i have for now...anyway ..i have what i want in JS arrrays > is there a war to perform CRUD operations on those arrays : my Arrays look like this : A1 : EmpID / A2 : Name / A3: Fistanme.. A1[0] : 1 / A1[0] : Paul /A1[0] : Newman A1[1] : 2 / A1[1] : Paul /A1[1] : Simon i want to be able to display the information like and give the ability to create , update or delete the record based on the EmpID unique number: EmpID / Name / Firstname 1 Paul Newman Update ( hyperlink) - Delete ( hyperlink) 2 Paul Simon Update ( hyperlink) - Delete ( hyperlink) i am using Coldfusion CF 7 and i was told since i want to keep the data into JS array that the only way to do it is usinig JAvascript any thoughts how can this be done./??? Thanks 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) Hi. This is my first post, so please bear with me!. I am writing some Javascript for some InDesign automation (shouldn't matter what for, but some background info). I have up to now been resorting to passing a script to Applescript, which then passed a shell command (via do script) to Terminal. This works, but is limiting my script to Mac only. I recently found I can open a socket, and send the PHP page my variables without leaving JavaScript.. Here is the code I am using with the Applescript combo: function combinedErrorReport(errorText) //errorText is something like "Library not found" { myServerAddress = "http://automation.yappp.net/"; errorText = encodeURI(errorText); myFullScriptString = "do shell script \"curl -0 "+ myServerAddress + "sendSrcError.php?e=" + errorText + "\""; myForceError = app.doScript(myFullScriptString, ScriptLanguage.APPLESCRIPT_LANGUAGE); } and this is what I want to use using a javascript socket... function combinedErrorReportWithSocket(errorText) //errorText is something like "Library not found" { myServerAddress = "automation.yappp.net:80"; errorText = encodeURI(errorText); conn = new Socket(); conn.open(myServerAddress); conn.write("GET /sendSrcError.php?e=" + errorText+"\ HTTP/1.0\n\n"); reply = conn.read(999999); conn.close; } The socket option simply does nothing. It opens the connection, but doesn't pass anything to the PHP. Anyone have any ideas? Cheers Roy Hello all, I am having some trouble getting my Javascript code to work properly. I want to create a program that allows two objects to race to a certain point which is 1000px in my program. I have figured out how to get the images to race at random speed, and I have figured out a function to reset the program if the user chooses to restart. Basically I can't figure out how to get the clearTimeout() to stop the Race() function when it reaches 1000px. I am fairly new to the Javascript world and could really use some suggestions or a point in the right direction. Thanks in advance, AJ. Here is my program so far: <body> <script language="JavaScript" type="text/javascript"> <!-- function StartUp() { if ((car1.style.pixelLeft<1000) && (car2.style.pixelLeft<1000)) { Race(); } else { alert(); } } function Race() { car1.style.pixelLeft+=(Math.floor(Math.random()*11)); car2.style.pixelLeft+=(Math.floor(Math.random()*11)); stop=setTimeout("Race()",50); } function Restart() { clearTimeout(stop); car1.style.pixelLeft=10; car2.style.pixelLeft=10; } function swapImage() { var image = document.getElementById("imageToSwap"); var length = document.getElementById("Road"); image.src = Road.value; } //--> </script> <div id="car1" style="position:absolute; top: 10"> <img src="Car1.gif" alt=""/> </div> <div id="car2" style="position:absolute; top: 75"> <img src="Car2.gif" alt=""/> </div> <img id="imageToSwap" src="Road1000.gif" alt=""/> <form name="form1"> <br> <input type="button" value="Race" onClick="StartUp()"> <input type="button" value="Restart" onClick="Restart()"> <br> Track Length: <select id="Road" name="Road" onChange="swapImage()"> <option value="Road1000.gif">1000 feet</option> <option value="Road750.gif">750 feet</option> <option value="Road500.gif">500 feet</option> <option value="Road250.gif">250 feet</option> </select> </form> </body> Hi, I have a parent form and a child form.. I have a checkboxlist in my child form. Users can select multiple values from checkbox list and on clicking button i want to pass selected values to parent form. Below is my code which works fine for passing value from child form to parent form (for the value entered in textbox) by clicking on button in child form textbox value is passed to parent form and child form closes, but how to pass multiple selected values from child to parent form. child Form: Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim scr As String = "<script language=javascript> function Done() { var lName=document.getElementById('txt_division').value; var ret= new Array(lName); window.opener.update(ret); window.close();}</script>" Page.RegisterClientScriptBlock("done", scr) End Sub Thanks to help with code / refer articles. Code: document.cookie = "score=400"; var x = document.cookie ; alert("Time Up"); window.location.href = "main.php?option=insert_result&result=" + x; In main.php I have a code that will save data on database. My question is why is that it saved something like score=200; PHPSESSID=m5v9qp5c9trcmfi9mso91b7nh5. All I want is 200 to be saved Hi, In this scrollable list table here (http://96.57.154.180), if you do a partial lookup, or type and submit "all" a big list gets generated and for some reason it works really fast in chrome and firefox, but works really slow in Internet Explorer. If you just take a glimpse, because it's all written in amateur javascript, do you notice anything terribly inefficient that I could change to maybe speed up the onmousemove refresh? What do you think in general about this approach to displaying large quantities of data at once? |