JavaScript - Urgent Help Needed In Javascript
I tried to write the variable my_var into a text file but it only shows null after executing the code. Can anybody help pls?? Below is my code
<html> <head> <script language="javascript"> var my_var function WriteToFile() { my_var = 123; document.write(<?php $file="file.txt"; $fh = fopen($file, 'w') or die("can't open file"); ?>; document.write(<?php $stringData = my_var ?>; document.write(<?php fwrite($fh, $stringData); ?>; document.write(<?php fclose($fh); ?>; } </script> </head> <body onLoad="WriteToFile();"> <p>Hello World</p> </body> </html> Similar TutorialsI need some help for University cousework that has been sent and I hope someone here can help. I need to create a cookie (easy enough) and then populate that cookie with a word that is selected when you click a certain image. Imagine you have image1.jpg and image2.jpg when a user selects image1.jpg the cookie needs to store image1 and load page2.html If the user selects image2, then page2.html still needs to load but store the word image2 in the cookie. On the next page, the cookie is loaded and the page needs to load the css file associated with that word example: image1 = firstcss.css image2 = secondcss.css Is this possible? Thank you for all your help Hi I have been trying to create a form using Django for a very long time but have not been able to get it to look the way I want. Someone suggested to me that I should use Javascript (Jquery) to do this. Here's what I want to do. For the form I want, there are certain statuses at the bottom, like "Done", "Incomplete" and etc. When the form is filled in, the person will click on one of these statuses. What I want this button to do is to save the page/form and also to generate a few new links relating to the status selected. For example, if the person selects "Done" this should save the form and generate two new buttons. One that says "Close" which would take you to the home page, and one that says "Continue" which would take you to the next form. My problem is that I'm new to Django and have no experience with Javascript. So if anyone could help or give me hints that would be greatly appreciated. I want to insert image instead of those empty boxes.......can someone help me please...... <script type="text/javascript"> document.write("<html><head><title>My PhotoCollage</title></head><body>"); function makeDiv() { var r = Math.floor(Math.random()*256); var g = Math.floor(Math.random()*256); var b = Math.floor(Math.random()*256); var wh = 25 + Math.floor(Math.random()*444); var lr = (Math.random()<.5) ? "top":"right"; var bw = 1 + Math.floor(Math.random()*12); var bs = (Math.random()<.5) ? " solid":"dotted"; var dc = (Math.random()<.5) ? "Dog" : "Cat"; var Img = Math.floor(Math.random()*256); document.write("<div style=\"float: "+lr+";"+ "width: "+wh+"px;"+ "height: "+wh+"px;"+ "border: rgb(" + g + "," + b + "," + r + ") "+bw+"px "+bs+";"+ "background-color: rgb(" + r + "," + g + "," + b + ");"+ "image: "\">"+dc+ "</div>"); } var i; var count = Math.floor(Math.random()*100) + 5; for (i=0; i<count; i++) makeDiv(); document.write("</body></html>"); </script> Hi I'm trying to download the security image from this site (at the bottom): http://pacesalsa.promotionexpert.com...2/register.jsp However, every time one refreshes the image, the image changes (obviously). So, I'm trying to figure out how to download the current image on the page to a jpg or png (or any image file type). Could someone please tell me how to do this? Thanks. I have been trying for hours to do the following: - Change the background of a div by clicking a link from another div tag. - It also needs to change back when clicked again. I know there are alot of experienced coders out there and I'm eager to learn... help would be appreciated! Friends i'm in a dire situation only have wednesday to submit ..so heres the problem....i have a course work assigment where i have to hardwire Hardware items and their item codes description and prices and ask the user to input their name address the itemCode and quantity nad then creat an invoice which looks like this HARDWARE ITEMS CODE DESCRIPTION UNIT PRICE K16 Wood screws, brass, 20mm, pack of 50 $ 7.75 D24 Wood glue, clear, 1 litre $ 5.50 M93 Sandpaper, medium grade, 100 sheets $10.25 M94 Sandpaper, fine grade, 100 sheets $14.75 PLACE YOUR ORDER! NAME: Bill Silic ADDRESS-1: Apt 23 ADDRESS-2: Building 8 ADDRESS-3: Winchester POST CODE: 89763 ENTER CODE (XX to Stop): CODE: D24 QUANTITY: 2 CODE: K16 QUANTITY: 1 CODE:XX INVOICE FOR ORDER Bill Silic Apt 23 Building 8 Winchester POST CODE: 89763 D24 Wood glue, clear, 1 litre 2 @ $ 5.50 $ 11.00 K16 Wood screws, brass, 20mm, pack of 50 1 @ $ 7.75 $ 7.75 TOTAL: $ 18.75 Shipping: 2 items @ 1.00 2.00 TOTAL INCL. SHIPPING: 20.75 VAT at 20% 4.15 TOTAL TO PAY: 24.90 I HAVE ALREADY COMPLETED THIS BY MYSELF AND GOT IT WORKING WITH NO PROBLEM ..But my problem is that the teacher wants us to TEST FOR NULL ENTRY meaning if the user enters the wrong Itemcode or no ItemCode at all and give an sensible output for that case ..... she wants us to put it in a method after main and then call it in main using a do while loop so my method looks something like this Code: public static boolean isSomethingCorrect(String itemCode){ if(itemCode.equals("")||itemCode.equals(null)){ System.out.println("A sensible output"); return true; }//close if return false; } } // and i have to implement it where i ask the user for input using a Do while loop in this area Code: //a do while loop to test null code entry do{ System.out.println("Please select a code from the list"); String itemCode= br.readLine(); System.out.println("Please enter quantity of items " +itemCode); String itemQuantity= br.readLine(); int quantity= Integer.parseInt(itemQuantity); // I Will be forever grateful for any help on this program because i have tryed for hours upon hours and i just cant get it and i need to submit the day after tomorrow Hi everyone, im no expert in coding but i manage to get this bit of code together using some free source stuff and put in the links to my images ect, the problem now is i need each picture to be different sizes and each one to have a clickable link but i am completely stumped heres the code Code: <html> <head> <script type="text/javascript"> <!-- var image1=new Image() image1.src="http://gohelp.org.uk/wp-content/uploads/2011/05/Charity-Rallies-World.png" var image2=new Image() image2.src="http://gohelp.org.uk/wp-content/uploads/2011/05/ROTW-logo.jpg" var image3=new Image() image3.src="http://gohelp.org.uk/wp-content/uploads/2011/05/Mongolia-Charity-Rally-Logo-Transparent.png" //--> </script> </head> <body> <center><img src="http://gohelp.org.uk/wp-content/uploads/2011/05/Charity-Rallies-World.png" name="slide" width="150" height="68" /></center> <script> <!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) return document.images.slide.src=eval("image"+step+".src") if (step<3) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> </body> </html> hi 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 Hi Guys, Im in need of some help with regards to forms. I am looking to build as basic as possible, a form that has 3 select dropdowns that have predetermined options. The user will select the first option and based on that option the second will populate and based on that, the third one will give the last option. Now, when the last one is selected, i need a div or a paragraph displaying information to be displayed. So here's the framework. Option 1 = fruit or vegitables of which fruit is selected is selected by the user Option 2 = Apples, Grapes, and pears of which apples is then selected Option 3 = Red, Green and Yellow of which Green is selected. Once green is selected, I need a description about the green aple to be displayed. Can anyone help me out on this? I am not sure where to begin and my boss is adament it must be done like yesterday. Ay help will be appreciated. Thanks. ===================[ URGENT ]================= confirm_state is not working properly..as it uses sajax..it is supposed to get the value of the state ..but the state being a string not working...please help.. ........................urgent......... <? function search_states($str) { //print $str; //print "<br><pre>"; $number=explode('-',$str); //print_r($number); //print $number[0]; if(count($number)==1) { $table='states'; $data=array('*'=>''); $fldarray=array("state"=>$number[0]); $val=dataSelectSearch($table,$data,$fldarray,$extra,$orderArray,$orderType); // print "<pre>"; // print_r($val); for($i=0;$i<count($val);$i++) { $state_name=$state_name."##".$val[$i]['state']; } return $state_name; } else { $strt_val=ord($number[0]); // Ascii of first character $end_val=ord($number[1]); // Ascii of last character //print chr($end_val); for($j=$strt_val;$j<=$end_val;$j++) { $table='states'; $data=array('*'=>''); $fldarray=array("state"=>chr($j)); $val=dataSelectSearch($table,$data,$fldarray,$extra,$orderArray,$orderType); for($m=0;$m<count($val);$m++) { $state_name=$state_name."##".$val[$m]['state']; } } return $state_name; } } ?> <script> function confirm_state1(msg) { // =============================== [subcategory follows ] ========================= //alert(msg); var value=msg; var arr=Array(); arr=value.split("##"); for(i=1;i<=(arr.length-1);i++) { //var new_val; //alert(i); //var int=Integer.valueOf(arr[i]); document.getElementById('innercontent').innerHTML=document.getElementById('innercontent').innerHTML+ "<br> <a href='javascript:void(0);' onclick='document.getElementById(state_name).value="+arr[i]+";' class='small_link1'>"+arr[i]+"</a>"; //document.getElementById('all_state').innerHTML=''; //alert(document.getElementById('innercontent').innerHTML); } } function showname(val) { //alert(msg1); alert(val); document.getElementById('state_name').value=val; document.getElementById('all_state').style.display='none'; } function findstate(str) { //alert(str); document.getElementById('innercontent').innerHTML=''; document.getElementById('all_state').style.display='inline'; var str1=str; x_search_states(str1,confirm_state1); } </script> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Get personal details</title> <!-- meta tags --> <meta name="keywords" content=""> <meta name="description" content=""> <!-- stylesheets --> <link rel="stylesheet" href="css/reset.css" type="text/css"> <link rel="stylesheet" href="css/common.css" type="text/css"> <!-- javascript --> <script src="js/jquery-1.3.2.min.js"></script> <!--conditional comments --> <!--[if IE]> <script src="js/html5.js"></script> <![endif]--> <script language="javascript" type="text/javascript"> function validName(n,c,l,d) { if(n.length == 0) { window.alert('A name must not be empty!'); return false; } if(c.length == 0) { window.alert('A country must not be empty!'); return false; } j = -1; for(i = l.length-1;i > -1;i--) { if(l[i].checked) { j = i;i = -1; } } if(j == -1) { window.alert('A like must not be empty!'); return false; } t = -1; for(s = d.length-1;s > -1;s--) { if(d[s].checked) { t = s;s = -1; } } if(t == -1) { window.alert('A dislike must not be empty!'); return false; } return true; } </script> </head> <body class="home"> <article id="page-content"> <section> <hgroup> <h2>Get personal details</h2> </hgroup> <form method="get" action="show_details.php" onSubmit="return validName(this.name.value,this.country.value,this.likes,this["dislikes[]"]);"> <table class="bordered"> <caption>Personal details form</caption> <tr> <th class="col1"> Property </th> <th class="col2"> Value </th> </tr> <tr> <td class="col1"> Name </td> <td class="col2"> <input type="text" name="name" size=30> </td> </tr> <tr> <td class="col1"> Age </td> <td class="col2"> <select name="age"> <option> 0-10 </option> <option> 11-20 </option> <option> 21-30 </option> <option> 31-40 </option> <option> 41-50 </option> <option> Over 50 </option> </select> </td> </tr> <tr> <td class="col1"> Country </td> <td class="col2"> <input type="text" name="country" size=30> </td> </tr> <tr> <td class="col1"> Likes </td> <td class="col2"> <input type="radio" name="likes" value="swimming">Swimming<br> <input type="radio" name="likes" value="running">Running<br> <input type="radio" name="likes" value="dancing">Dancing<br> <input type="radio" name="likes" value="biking">Biking<br> <input type="radio" name="likes" value="surfing">Surfing<br> </td> </tr> <tr> <td class="col1"> Dislikes </td> <td class="col2"> <!-- The value of dislikes is an array of checked values --> <input type="checkbox" name="dislikes[]" value="dogs">Dogs<br> <input type="checkbox" name="dislikes[]" value="cats">Cats<br> <input type="checkbox" name="dislikes[]" value="birds">Birds<br> <input type="checkbox" name="dislikes[]" value="fish">Fish<br> <input type="checkbox" name="dislikes[]" value="plants">Plants<br> </td> </tr> <tr> <td class="col1"> Description </td> <td class="col2"> <textarea name="description" rows=6 cols=30></textarea> </td> </tr> <tr> <td colspan=2 style="text-align: center"> <input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </td> </tr> </table> </form> </section> </article> </body> </html> I cant for the life of me find out why it wont display the javawindow anymore? suppose to pop up when you dont enter a name, country, check a radio or checkbox This is a code I wrote about a javascript game which you should click on each picture so that the puzzle will be done. I have nine pictures with each picture named 1.jpg 2.jpg --- 9.jpg I have three difficulties beginner intermediate hard . The code has logical errors I can't understand . can anybody help me <html> <head> <title> CAIS326 Assignment 3 </title> <script type="text/javascript"> <!-- var seconds = 0; var timerId; var time; var Click1 = 0,Click2 = 0,Click3 = 0,Click4 = 0,Click5 = 0,Click6 = 0,Click7 = 0,Click8 = 0,Click9 = 0; var Pictures = [1,2,3,4,5,6,7,8,9]; function SwapImages() { for(var q=0 ; q<9; q++) document.getElementById("image+q+").src = Pictures[Click+q+ -1]+".jpg"; } function RegisterClicks(Index) { if (Click1 == 0) Click1 = Index; else if (Click2 == 0) Click2 = Index; else if (Click3 == 0) Click3 = Index; else if (Click4 == 0) Click4 = Index; else if (Click5 == 0) Click5 = Index; else if (Click6 == 0) Click6 = Index; else if (Click7 == 0) Click7 = Index; else if (Click8 == 0) Click8 = Index; else if (Click9 == 0) Click9 = Index; for(var m=0; m<9; m++) { if (Click+m+ > 0 && Click+m + 1+ > 0){ SwapImages(); Click+m+ = 0; Click+m + 1+ = 0; } } } function startTimer() { if (document.form1.gamelevel[0].checked) time=60; else if (document.form1.gamelevel[1].checked) time=45; else time=30; // 1000 milliseconds = 1 second timerId = window.setInterval( "updateTime()", 1000 ); } function updateTime() { seconds++; soFar.innerText = seconds; if ( time == seconds) { seconds = 0; window.alert ("Game over Loser..."); clearTimeout(timerId); } } var array = new Array(9); for (var i=0; i<9; i++) { array[i] = i+1; } shuffle(); document.writeln("<table border=1>"); var b = 0; while (b < 9 ) { var num = array[b]; document.writeln("<tr><td><img src=\""+num+".jpg\" id =\"image"+num+" \" onClick=\"RegisterClicks("+num+")\" /></td>"); ++b; num = array[b]; document.writeln("<td><img src=\""+num+".jpg\" id =\"image"+num+" \" onClick=\"RegisterClicks("+num+")\" /></td>"); ++b; num = array[b]; document.writeln("<td><img src=\""+num+".jpg\" id =\"image"+num+" \" onClick=\"RegisterClicks("+num+")\" /></td></tr>"); ++b; } document.writeln("</table>"); function shuffle() { var k = 9; var RandNum; var Temp; for (var n=0; n<9; n++) { RandNum = Math.floor(Math.random()*k); Temp = array[k-1]; array[k-1] = array[RandNum]; array[RandNum] = Temp; k=k-1; } } //--> </script> </head> <body> <form name = "form1" action = ""> <input type="Radio" name = "gamelevel" Value = "Beginner" Checked = "true" /> <font color=#37448E>Beginner</font> <input type="Radio" name = "gamelevel" Value = "Intermediate" /> <font color=#37448E>Intermediate</font> <input type="Radio" name = "gamelevel" Value = "Advanced" /> <font color=#37448E>Advanced</font></div><br/><br/> <input type = "button" value = " start " onClick="startTimer()"/><br/> <p>Seconds you have spent viewing this page so far: <strong id = "soFar">0</strong></p> </form> </body> </html> Hello everyone, I'm using both Lightbox 2 and PrettyPhoto in Wordpress. Is there any way I can run both simultanously? They second Lightbox is on PrettyPhoto stops working. This is for 313Coupons.com . If anyone can help me I can recreate the problem. Right now all the Javascripts are enabled so the Homepage isn't displaying the Javascript elements that are done through PrettyPhoto. However, if you go to http://313coupons.com/as/ for example and press the coupon on the bottom, it'll open up in Lightbox 2. I need this because of the Print Button feature of Lightbox 2 which I can't find in any other Lightbox plugin. Any ideas? Please this is urgent. I have a sliding flyout menu on the facebook icon on my page: http://www.billboardfamily.com The problem is that it is dropping down, rather than sliding out to the left as it is supposed to. There are 3 .js files, and then the code that make this all happen. Tell me what you need to see and I will get it on here. This is the last item to fix on the site and it is done. You can see what it is supposed to do he http://i8ramin.github.com/jquery.smarttoggle/ Just hover over the "menu" button at the top-right of the white section. I'm having trouble with a Javascript pop up box not appearing on Internet Explorer. I have tested it with IE7 and IE8 with no success. It works on Firefox 3.6.3 and Opera. On internet explorer this yellow bar appears; However, once clicked and given temporary permission the page reloads not showing the pop up box and the yellow bar is still present. I have re-created the situation here; http://html.comuf.com/ problem.html is the page I need help on. The correct password is real which redirects you to real.html. I am open to using new scripts but this line/function is crucial; Code: location.href= password + ".html"; This problem is for a friend of mine who does design work, his client is having trouble with this. The pop up box must appear after allowed temp through IE, or even better no user allowance is required while keeping the password +.html code. P.S. I plan to stick around and learn after this gets answered! Greetings fellow coders, I am having an issue with my rollover images. The first image (when hovered over) is fine, however when I hover over the second image the mouseover effect replaces the first jpg. Any idea how I can seperate the behaviours so my 2nd image mouseover glow is in it's correct place? Thanks in advance, Zeme Andrews Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script language="javascript" type="text/javascript"> if (document.images) { var button1 = new Image(); var button2 = new Image(); var button3 = new Image(); var button4 = new Image(); var button5 = new Image(); var button6 = new Image(); button1.src= "images/thumb1.jpg" ; button2.src= "images/thumb1_glow.jpg"; button3.src= "images/thumb2.jpg"; button4.src= "images/thumb2_glow.jpg"; button5.src= "images/thumb3.jpg"; button6.src= "images/thumb3_glow.jpg"; } </script> <script type="text/javascript" src="/nav/tb/jquery.js"></script> <script type="text/javascript" src="/nav/tb/thickbox.js"></script> </head> <body> <table width="530" border="5" cellspacing="0" cellpadding="0" align="left"> <tr><td align="justify"> <img src="images/thumb1.jpg" height="230" width="150" alt="" border="2" hspace="5" name="rollover" onmouseover="document.rollover.src=button2.src" onmouseout="document.rollover.src=button1.src" /> <img src="images/thumb2.jpg" height="230" alt="" width="150" border="2" hspace="5" name="rollover_1" onmouseover="document.rollover.src=button4.src" onmouseout="document.rollover.src=button3.src" /> <img src="images/thumb3.jpg" height="230" alt="" width="150" border="2" hspace="5" name="rollover_2" onmouseover="document.rollover.src=button6.src" onmouseout="document.rollover.src=button5.src" /> </td></tr> </table> </body> </html> Hi , I have 4 input form fields and when user enters data in any number of fields like he enter data in 2 fields and left 2 fields blank like(123, ,456, ,), i need to check on blur event so that it has to check for empty fields and once empty fields exits then it has to sort out all the data presented fields and then placed back to input fields like (456,123, , ,). i am new to java script and i have no idea how to implement this , please help me thanks. <input type="text" name="itemMod1_1" size="5" maxlength="5" class="mono" > <input type="text" name="itemMod2_1" size="5" maxlength="5" class="mono" > <input type="text" name="itemMod3_1" size="5" maxlength="5" class="mono" > <input type="text" name="itemMod4_1" size="5" maxlength="5" class="mono" > Pretty pretty please help me with this I am running out of time and pulling my hair out with this whole thing. Thanks a million in advance! Rhonda <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script> function numberGuess() { stringVar=prompt("Enter your guess number"); while (stringVar<999) { } } </script> <script> function enterNames() { stringVar=prompt("Enter name"); } </script> <script> function enterProducts() { stringVar=prompt("Enter product name"); return } </script> </head> <body> <p> </p> <h1>WDV221 Intro Javascript</h1> <h3 align="center">Javascript Loops</h3> <p>Topics: loops, for loops, while loops, sentinels!</p> <p>Place all script code on this page.</p> <p>1. Create a function that will ask you for a number until you enter 999 which will end the loop. You do not need to display the number. </p> <p>2. Create a function that will ask you for a name until you tell the function that you do not have any more names. After you enter each name it will ask you if you have more names to enter. If you enter yes the process will continue. Display each name at the end of the following sentence.</p> <p>The name you entered is: </p> <p>3. Create a runtime script that will use a prompt( ) to accept how many products will be displayed. Use a for loop to display "Product Name" and the product number as a <p> element.</p> <p><strong>Example output:</strong></p> <p>Product Name 1</p> <p>Product Name 2</p> <p>...</p> <p>4. Create a runtime script that will use a nested for loop to create a table with 3 rows and 5 cells. Place the same number or a letter in each cell. </p> <p>Hint: Write a table in HTML. Do a row first then do multiple rows. </p> <p>5. Create a function called totalSales( ) that will ask the user to enter an amount until you enter "done". Add those amounts together and display them in an alert when the user is done entering amounts..</p> <p>Have fun!!</p> </body> </html> new to JavaScript, simple question... question: how do i determine an output from a prompt to be bold? e.g. a user enters "hello" and the output printed from the prompt becomes bold one=parseFloat(prompt('enter number',0.bold)); I'm working very hard to create a dynamic web-site for use in the education sector using server-side php/MySQL and client-side HTML with javascript. I have a logon page (index.php) which looks to see if the cookie 'mylogon' is set with the value 'Again'. This cookie is set when the PHP element on the server detects an invalid username/password combination. If so I have a javascript function (see below) call from the HTML <body onload="check_invalid_user()"> I know that the function Get_Cookie is working ok and that the javascript variable 'again' has the value 'Again' in it and has a length of 5. The alert function is not executed though. function check_invalid_user() { again = Get_Cookie('mylogon'); // document.write(again); // document.write(again.length); If (again == 'Again') { alert("User-id and/or password incorrect -- Please re-enter"); } } ============= Any help would be appreciated Many thanks in advance. (Yeah you guessed it I'm new and raw to this stuff. |