JavaScript - Buttons Dont Work
I have buttons that check all the check boxes and uncheck all the checkboxes. They seem to not be working.
Here is the code. Javascript Code: <script type="text/javascript"> function checkall(delchk) { for (i = 0; i < delchk.length; i++) delchk[i].checked = true; } </script> <script type="text/javascript"> function uncheckall(delchk) { for (i = 0; i < delchk.length; i++) delchk[i].checked = false; } </script> PHP PHP Code: <?php error_reporting(E_ALL); require("inc/config.php"); if (isset($_POST['del'])) { for ($count = 0;$count<count($_POST[delchk]);$count++) { $delete = $_POST[delchk][$count]; $query = "DELETE FROM persons WHERE id = '$delete'"; $result = mysql_query($query); if (!$result) { die("Error deleting persons! Query: $query<br />Error: ".mysql_error()); } } } $result = mysql_query("SELECT * FROM persons"); // Check how many rows it found if(mysql_num_rows($result) > 0){ echo "<table id=\"mytable\"> <thead> <tr> <th align=\"center\" scope=\"col\">Delete?</th> <th align=\"center\" scope=\"col\">First Name</th> <th align=\"center\" scope=\"col\">Last Name</th> <th align=\"center\" scope=\"col\">Profile</th> <th align=\"center\" scope=\"col\">Date</th> <th align=\"center\" scope=\"col\">IP Address</th> </tr> </thead> <tbody>"; echo "<form name = 'myform' action='' method='post'>"; while($row = mysql_fetch_array($result)) { echo "<tr align=\"center\">"; echo '<td><input type="checkbox" id="delchk" name="delchk[]" value="'.$row['id'].'" /></td>'; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "<td><a target=frame2 href='" ."profile.php?user1=". $row['FirstName'] ."'>Check Profile</a></td>"; echo "<td>" . $row['AddedDate'] . "</td>"; echo "<td>" . $row['Ip'] . "</td>"; echo "</tr>"; } echo "</tbody>"; echo "</table>"; echo "<hr>"; echo "<input type='submit' name = 'del' value='Delete Selected'></form>"; echo "<input type='button' onclick='checkall(document.myform[\"delchk[]\"]);' value='Select All'>"; echo "<input type='button' onclick='uncheckall(document.myform[\"delchk[]\"]);' value='UnSelect All'>"; } else{ // No rows were found ... echo 'No registered members.'; } mysql_close(); ?> Similar TutorialsI have a site that works just fine in fire fox but surprise surprise, there is a lot of problems in IE8 that dont make sense at all. Here is my link: http://paperlesswasp.com/royalvillicus/recompare.php Code: <span class="menu1" id="menu1"> <map name="menu1" id="menu1"> <area alt="memberships" shape="rect" coords="134, 143, 176, 166" href="http://realtor.com"/> <area alt="memberships" shape="rect" coords="188, 143, 231, 166" href="http://realestate.yahoo.com/"/> <area alt="memberships" shape="rect" coords="243, 143, 285, 166" href="http://realestate.com"/> <area alt="memberships" shape="rect" coords="297, 143, 340, 166" href="http://frontdoor.com"/> <area alt="memberships" shape="rect" coords="351, 143, 394, 166" href="http://homes.com"/> </map> <img src="image/rsummary.png" alt="site comparison" usemap="#menu1" width="" height="" vspace="5" hspace="1"/><br><br> </span> <span id="ex_10" style="display:none;"> <img src="image/rranking.png" name="ex_4" id="ex_4" alt="ranking" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_9" style="display:none;"> <img src="image/relistings.png" name="ex_5" id="ex_5" alt="listings" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_6" style="display:none;"> <img src="image/relistingsearches.png" name="ex_6" id="ex_6" alt="listings searches" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_7" style="display:none;"> <img src="image/recalculators.png" name="ex_7" id="ex_7" alt="calculators" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_8" style="display:none;"> <img src="image/reresources.png" name="ex_8" id="ex_8" alt="resources" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_11" style="display:none;"> <img src="image/remarketdata.png" name="ex_8" id="ex_8" alt="resources" width="" height="" vspace="5" hspace="1"/><br> </span> if you look under: http://paperlesswasp.com/royalvillicus/calculator.php IE8 will only show 2 out of the 7 drop down menu bars that are suppose to be there. works in IE8 and firefox Code: <img src="image/wroi.png" onmouseover="rollOn(this)" onmouseout="rollOff(this)" onclick="showMe(12)" vspace="1" hspace="1" class="position"><br><br> works only in firefox Code: <img src="image/wtax.png" onmouseover="rollOn(this)" onmouseout="rollOff(this)" onclick="showMe(11)" vspace="1" hspace="1" class="position"><br><br> Fire fox handles these just fine, but IE8 doesnt. I appreciate any siggestions I' am trying to do a frame by frame animation, lik an animated gif. I am using svg (vector graphics) and IE9 has native support for svg. The code functions in every other browser but IE9 plays the animation once then nothing. If you would like to try and not have svg files you can use whatever gif,jpg or png just put an img-tag where i have embed. Code: <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Animation</title> <style type="text/css"> /*One div per image all uses this class*/ .eyesPos { position:absolute; width:80px; height:50px; z-index:1; left: 0px; top: 0px; } #eye_wrapper{/*This is a master div for easy placement of the others*/ position:absolute; width:80px; height:50px; z-index:2; left: 275px; top: 200px; } </style> <script> var eyes=["a","b","c","d"];//Image id in this array var startAnim=setInterval(visaOga,100);//Animation speed function visaOga(){ document.getElementById(eyes.splice(0,1)).style.display="block"; if(eyes.length==0){ document.getElementById("a").style.display="none"; document.getElementById("b").style.display="none"; document.getElementById("c").style.display="none"; dBort = function(){ document.getElementById("d").style.display="none"; eyes=["a","b","c","d"]; } setTimeout(dBort,1500);//So last image is shown 1.5 sec return;//Aborts - dBort -. Sequence can start over if(document.getElementById("d").style.display=="none"){ startAnim;//Strts sequence if last image invisible } } } </script> </head> <body> <!--Images in own div invisible at start--> <div id="eye_wrapper"> <div class="eyesPos" id="a" style= display:none;> <embed src="0.svg" width="80" height="50" /> </div> <div class="eyesPos" id="b" style= display:none;> <embed src="1.svg" width="80" height="50" /> </div> <div class="eyesPos" id="c" style= display:none;> <embed src="2.svg" width="80" height="50" /> </div> <div class="eyesPos" id="d" style= display:none;> <embed src="3.svg" width="80" height="50" /> </div> </div> </body> </html> Hello, I have a script that lets you add tasks to a task list and then you can click a button to sort them, but I cannot get the "Delete Selected Task" and "Delete All Tasks" buttons to work correctly. I will be eternally indebted to whoever can help me fix these two buttons. The code I am working on is posted below. Thank you for your time. [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>To Do List</title> <script type="text/javascript"> /* <![CDATA[ */ function addTask() { if (document.forms[0].newtask.value == "") window.alert("You must enter a value in the New Task field."); else { if (document.forms[0].tasks.options.value == "tasks") document.forms[0].tasks.options[0] = null; var newTask = new Option(); newTask.value = document.forms[0].newtask.value; newTask.text = document.forms[0].newtask.value; var numTasks = document.forms[0].tasks.options.length; document.forms[0].tasks.options[numTasks] = newTask; document.forms[0].newtask.value = ""; } } function deleteTask() { var selectedTask = 0; var taskSelected = false; while (selectedTask < document.forms[0].tasks.length) { if (document.forms[0].tasks.options[selectedTask].selected == true) { taskSelected = true; break; } ++selectedTask; } if (taskSelected == true) document.forms[0].tasks.options[selectedTasks] = null; else window.alert("You must select a task in the list."); } function ascendingSort() { var newTasks = new Array(); for (var i =0; i < document.forms[0].tasks.length; ++i) { newTasks[i] = document.forms[0].tasks.options[i].value; } newTasks.sort(); for (var j =0; j < document.forms[0].tasks.length; ++j) { document.forms[0].tasks.options[j].value = newTasks[j]; document.forms[0].tasks.options[j].text = newTasks[j]; } } /* ]]> */ </script> </head> <body> <h1>To Do List</h1> <form action=""> <p>New Task <input type="text" size="68" name="newtask" /></p> <p><input type="button" value="Add Task" onclick="addTask()" style="width: 150px" /> <input type="button" value="Delete Selected Task" onclick="deleteTask()" style="width: 150px" /> <input type="button" value="Delete All Tasks" onclick="document.forms[0].task.options.length = 0;" style="width: 150px" /><br /> <input type="button" value="Ascending Sort" onclick="ascendingSort()" style="width: 150px" /> </p> <p><select name="tasks" size="10" style="width: 500px"> <option value="tasks">Tasks</option></select></p> </form> </body> </html> [CODE] I got this code to WORK with Buttons... But, i can NOT get it to work with URLs/LINKs... dose anyone have any suggestions? The URL alternative LINKs are placed below the buttons... but like i have said, they don't work. Help Pleeeeese. Thanks. ****HEAD <script language="javascript" type="text/javascript"> function getCheckedValue() { document.getElementById("presentationsNavBars").style.display = 'block'; document.getElementById("proposalsNavBars").style.display = 'none'; document.getElementById("postingsNavBars").style.display = 'none'; document.getElementById("myaccountNavBars").style.display = 'none'; } function getCheckedValue2() { document.getElementById("presentationsNavBars").style.display = 'none'; document.getElementById("proposalsNavBars").style.display = 'block'; document.getElementById("postingsNavBars").style.display = 'none'; document.getElementById("myaccountNavBars").style.display = 'none'; } function getCheckedValue3() { document.getElementById("presentationsNavBars").style.display = 'none'; document.getElementById("proposalsNavBars").style.display = 'none'; document.getElementById("postingsNavBars").style.display = 'block'; document.getElementById("myaccountNavBars").style.display = 'none'; } function getCheckedValue4() { document.getElementById("presentationsNavBars").style.display = 'none'; document.getElementById("proposalsNavBars").style.display = 'none'; document.getElementById("postingsNavBars").style.display = 'none'; document.getElementById("myaccountNavBars").style.display = 'block'; } </script> ****** BODY <div class="student_text"> <asp:RadioButton ID="RadioButton1" GroupName="reg" Text="presentations" runat="server" OnClick="return getCheckedValue();" /> <br /> <%--OR how do i get it to work when using a URL as shown below for example--%> <a href="navPageTest2.aspx" runat="server" onclick="getClickedValue();">Presentations_link_ex</a><br /> </div> <br /><br /> <div class="student_text"> <asp:RadioButton ID="RadioButton2" GroupName="reg" Text="proposals" runat="server" onclick="return getCheckedValue2();" /> <br /> <%--OR how do i get it to work when using a URL as shown below for example--%> <a href="navPageTest2.aspx" onclick="getClickedValue2();">Proposals_link_ex</a><br /> </div> <br /><br /> <div class="student_text"> <asp:RadioButton ID="RadioButton3" GroupName="reg" Text="postings" runat="server" onclick="return getCheckedValue3();" /> <br /> <%--OR how do i get it to work when using a URL as shown below for example--%> <a href="navPageTest2.aspx" onclick="getClickedValue3();">Postings_link_ex</a><br /> </div> <br /><br /> <div class="student_text"> <asp:RadioButton ID="RadioButton4" GroupName="reg" Text="myaccount" runat="server" onclick="return getCheckedValue4();" /> <br /> <%--OR how do i get it to work when using a URL as shown below for example--%> <a href="navPageTest2.aspx" onclick="getClickedValue4();">Myaccount_link_ex</a><br /> </div> <br /><br /> ****************************** start display ***************************** <br /><br /> <div id="presentationsNavBars" style="display: none;"> SOME HTML HERE ..........presentations nav bar............ </div> <div id="proposalsNavBars" style="display: none;" > SOME HTML HERE 44444444 proposals nav bar 44444444444 </div> <div id="postingsNavBars" style="display: none;" > SOME HTML HERE 2222222 postings nav bar 2222222222222 </div> <div id="myaccountNavBars" style="display: block;" > SOME HTML HERE 33333333 myaccount nav bar 33333333 </div> <br /><br /> ****************************** end ***************************** so here is my "Project" for this class http://sw.cs.wwu.edu/~strickk/Project2/project2.html and here are the directions where im stuck at, just right click view source to see the code. I believe what i am doing wrong is where i enter my variables and i dont know how to get an alert message to pop up using an if statement as well as getting the values for the distances to show up correctly directions: 8. Now we will write some JavaScript to validate the input. We don’t want the user to be able to enter the same origin and destination city when they book a ticket. So we will use an if statement to check that. If they have entered the same origin and destination city then we will tell them that by using an alert statement and make them select again. All of your code to validate the input code goes in between the single quotes of the onClick event in the Calculate Fare button. Follow these steps: a) Assign the value of the origin city to a variable called origin Note that the value that gets assigned to origin is actually 0, 60, 90, 120 or 150 (and NOT Bellingham, Everett, Seattle etc.) since the value we gave to the each element of the list was its distance from Bellingham. This will make our lives easier later when we compute the fare. b) Assign the value of the destination city to a variable called destination in a similar fashion. c) Write an if statement that will test whether origin is equal to destination and if it is then do two things. i. Issue an alert message that says Please input different origin and destination cities ii. Stop the execution of the JavaScript code in the onClick event. Use return; as the second statement inside the if statement. Remember to use curly braces to denote that two statements are contained within the if statement. Your if statement will have the following structure to it. if (<put the test you want to do here>) { alert(<put the message here>); return; Hey, I am needing some help trying to remember what is the name of this type of javascript content expand script. It looks like this: It doesnt have to look like that but the same general example of expanding and contracting tabs with the arrow that switches when its open and closed. Thanks alot! Some links would be nice. Please Check the webpage to see what I am trying to do. I am told It cant be done in HTML. That I will have to use Java Script. Can someone Please help me out here. Go to: http://www.capthelm.net If You can assist me please use the email link on my site. Thanks. The Captain Hi, it's my first post and first thread, actually I joined to ask this question. I did try searching first but for some reason when I put this character in google search fields I never find what I want, maybe not being recognized. here's the code Code: this.size=a.size||2000; this.handle_event=a.handle_event||'click'; my question ... what is the || character(s)? I'm sure this must be laughably simple and thanks in advance (new to learning js) Ok, will do, I guess I could sum up the problem now that I think about it into a very simple question. How do you make a variable variable in a loop? ex while(i<=20) { _A_+var+ = multiple vars with var endings like the beginning of this one } Please help me figure out how the f to shorten this ... Trying to turn this into a series of loops has been hell on earth (no good at this part of making a website, the javascript part that is) anyways, I was told by someone that was fairly smug that my javascript was retarded, I don't disagree but it works very well and I don't know enough to make it any other way. Please help me figure out how to shorten this rather than complain about the method I used for making the site. If you have a hotfile or rapidshare account I can pay you for your help by uploading 100 files to your account and using those links on my site to earn around $2 - $40 depending on popularity. (That's what I'm estimating though, and it will take about three months since I need to get users first) The site that needs this upgrade http://www.thefreemenu.com Right now this site is at the very beginning stages mostly due to my incompetence but I would really like to start moving things forward. I'm two months into this project and the last week and a half have really stalled to a stop. Its to slow to load and I really need to shorten the javascript so that it doesn't take up 600 k (bananascript version!). The below is repeated 10x for every letter and number as well as a special bit called all1. Here is the first example using _A_1 as the only part that changes. The next set is for the second page of the letter A so its called _A_p2_1, so basically I need this all the way to _A_p10_1 and I need it for all the letters of the alphabet, ex. _B_1, _B_p2_1. I don't understand how to loop but I think that it must be possible, but I really don't get it at all. I've studied loops, while, for and nothing I've learned has helped me solve this problem. Right now my .js file is 3mbs and I need to cut it down. Please help me figure this out, I"m a noob at javascript but I've created some pretty complex things and somehow manage to have them work. I think I'll get it if you can provide a small example using what I need to work with. Code: _A_0[0]='<ul class="freemenu"><li class="movieimage'; _A_0[1]='"><img src="images\/movies\/'; _A_0[2]='.png" width="75" height="120" \/><ul>\n <li class="hotlink'; _A_0[3]='"><a href="#" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onclick="addText(\''; _A_0[4]='\')"><img src="images\/hotfile.png" width="70" height="43" \/><\/a><\/li>\n <li class="rapidlink'; _A_0[5]='\')"><img src="images\/rapidshare.png" width="55" height="50"\/><\/a><\/li>\n <li class="information'; _A_0[6]='">\n <textarea name="textarea" cols="51" rows="30" style="overflow:hidden;" readonly="readonly" wrap="virtual" >'; _A_0[7]='<\/textarea>\n <\/li>\n<\/ul>\n<\/li>\n <\/ul>\n'; _AC_0[1]=(_A_0[0]+_nl_0[1]+_A_0[1]+_img_0[1]+_A_0[2]+_nl_0[1]+_A_0[3]+_h_0[1]+_A_0[4]+_nl_0[1]+_A_0[3]+_r_0[1]+_A_0[5]+_nl_0[1]+_A_0[6]+_i_0[1]+_A_0[7]); _AC_0[2]=(_A_0[0]+_nl_0[2]+_A_0[1]+_img_0[2]+_A_0[2]+_nl_0[2]+_A_0[3]+_h_0[2]+_A_0[4]+_nl_0[2]+_A_0[3]+_r_0[2]+_A_0[5]+_nl_0[2]+_A_0[6]+_i_0[2]+_A_0[7]); _AC_0[3]=(_A_0[0]+_nl_0[3]+_A_0[1]+_img_0[3]+_A_0[2]+_nl_0[3]+_A_0[3]+_h_0[3]+_A_0[4]+_nl_0[3]+_A_0[3]+_r_0[3]+_A_0[5]+_nl_0[3]+_A_0[6]+_i_0[3]+_A_0[7]); _AC_0[4]=(_A_0[0]+_nl_0[4]+_A_0[1]+_img_0[4]+_A_0[2]+_nl_0[4]+_A_0[3]+_h_0[4]+_A_0[4]+_nl_0[4]+_A_0[3]+_r_0[4]+_A_0[5]+_nl_0[4]+_A_0[6]+_i_0[4]+_A_0[7]); _AC_0[5]=(_A_0[0]+_nl_0[5]+_A_0[1]+_img_0[5]+_A_0[2]+_nl_0[5]+_A_0[3]+_h_0[5]+_A_0[4]+_nl_0[5]+_A_0[3]+_r_0[5]+_A_0[5]+_nl_0[5]+_A_0[6]+_i_0[5]+_A_0[7]); _AC_0[6]=(_A_0[0]+_nl_0[6]+_A_0[1]+_img_0[6]+_A_0[2]+_nl_0[6]+_A_0[3]+_h_0[6]+_A_0[4]+_nl_0[6]+_A_0[3]+_r_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nl_0[20]+_A_0[3]+_h_0[20]+_A_0[4]+_nl_0[20]+_A_0[3]+_r_0[20]+_A_0[5]+_nl_0[20]+_A_0[6]+_i_0[20]+_A_0[7]); var _20_0=(_AC_0[1]+_AC_0[2]+_AC_0[3]+_AC_0[4]+_AC_0[5]+_AC_0[6]+_AC_0[7]+_AC_0[8]+_AC_0[9]+_AC_0[10]+_AC_0[11]+_AC_0[12]+_AC_0[13]+_AC_0[14]+_AC_0[15]+_AC_0[16]+_AC_0[17]+_AC_0[18]+_AC_0[19]+_AC_0[20]); _A_p2_0[0]='<ul class="freemenu"><li class="movieimage'; _A_p2_0[1]='"><img src="images\/movies\/'; _A_p2_0[2]='.png" width="75" height="120" \/><ul>\n <li class="hotlink'; _A_p2_0[3]='"><a href="#" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onclick="addText(\''; _A_p2_0[4]='\')"><img src="images\/hotfile.png" width="70" height="43" \/><\/a><\/li>\n <li class="rapidlink'; _A_p2_0[5]='\')"><img src="images\/rapidshare.png" width="55" height="50"\/><\/a><\/li>\n <li class="information'; _A_p2_0[6]='">\n <textarea name="textarea" cols="51" rows="30" style="overflow:hidden;" readonly="readonly" wrap="virtual" >'; _A_p2_0[7]='<\/textarea>\n <\/li>\n<\/ul>\n<\/li>\n <\/ul>\n'; _AC_p2_0[1]=(_A_p2_0[0]+_nl_p2_0[1]+_A_p2_0[1]+_img_p2_0[1]+_A_p2_0[2]+_nl_p2_0[1]+_A_p2_0[3]+_h_p2_0[1]+_A_p2_0[4]+_nl_p2_0[1]+_A_p2_0[3]+_r_p2_0[1]+_A_p2_0[5]+_nl_p2_0[1]+_A_p2_0[6]+_i_p2_0[1]+_A_p2_0[7]); _AC_p2_0[2]=(_A_p2_0[0]+_nl_p2_0[2]+_A_p2_0[1]+_img_p2_0[2]+_A_p2_0[2]+_nl_p2_0[2]+_A_p2_0[3]+_h_p2_0[2]+_A_p2_0[4]+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_A_p2_0[3]+_r_p2_0[17]+_A_p2_0[5]+_nl_p2_0[17]+_A_p2_0[6]+_i_p2_0[17]+_A_p2_0[7]); _AC_p2_0[18]=(_A_p2_0[0]+_nl_p2_0[18]+_A_p2_0[1]+_img_p2_0[18]+_A_p2_0[2]+_nl_p2_0[18]+_A_p2_0[3]+_h_p2_0[18]+_A_p2_0[4]+_nl_p2_0[18]+_A_p2_0[3]+_r_p2_0[18]+_A_p2_0[5]+_nl_p2_0[18]+_A_p2_0[6]+_i_p2_0[18]+_A_p2_0[7]); _AC_p2_0[19]=(_A_p2_0[0]+_nl_p2_0[19]+_A_p2_0[1]+_img_p2_0[19]+_A_p2_0[2]+_nl_p2_0[19]+_A_p2_0[3]+_h_p2_0[19]+_A_p2_0[4]+_nl_p2_0[19]+_A_p2_0[3]+_r_p2_0[19]+_A_p2_0[5]+_nl_p2_0[19]+_A_p2_0[6]+_i_p2_0[19]+_A_p2_0[7]); _AC_p2_0[20]=(_A_p2_0[0]+_nl_p2_0[20]+_A_p2_0[1]+_img_p2_0[20]+_A_p2_0[2]+_nl_p2_0[20]+_A_p2_0[3]+_h_p2_0[20]+_A_p2_0[4]+_nl_p2_0[20]+_A_p2_0[3]+_r_p2_0[20]+_A_p2_0[5]+_nl_p2_0[20]+_A_p2_0[6]+_i_p2_0[20]+_A_p2_0[7]); var _20_p2_0=(_AC_p2_0[1]+_AC_p2_0[2]+_AC_p2_0[3]+_AC_p2_0[4]+_AC_p2_0[5]+_AC_p2_0[6]+_AC_p2_0[7]+_AC_p2_0[8]+_AC_p2_0[9]+_AC_p2_0[10]+_AC_p2_0[11]+_AC_p2_0[12]+_AC_p2_0[13]+_AC_p2_0[14]+_AC_p2_0[15]+_AC_p2_0[16]+_AC_p2_0[17]+_AC_p2_0[18]+_AC_p2_0[19]+_AC_p2_0[20]); Another part that I'm not so worried about but that still takes up a ton of space is the corresponding variables that need to be set as blank, this one being for a instead of 0(zero) like in the previous example. Code: var _nl_a =new Array() var _img_a =new Array() var _h_a =new Array() var _r_a =new Array() var _i_a =new Array() var _A_a =new Array() var _AC_a =new Array() _nl_a[1] = 1; _img_a[1] = 'nocontent7'; _h_a[1] = ''; _r_a[1] = ''; _i_a[1] = ''; _nl_a[2] = 2; _img_a[2] = 'nocontent7'; _h_a[2] = ''; _r_a[2] = ''; _i_a[2] = ''; _nl_a[3] = 3; _img_a[3] = 'nocontent7'; _h_a[3] = ''; _r_a[3] = ''; _i_a[3] = ''; _nl_a[4] = 4; _img_a[4] = 'nocontent7'; _h_a[4] = ''; _r_a[4] = ''; _i_a[4] = ''; _nl_a[5] = 5; _img_a[5] = 'nocontent7'; _h_a[5] = ''; _r_a[5] = ''; _i_a[5] = ''; _nl_a[6] = 6; _img_a[6] = 'nocontent5'; _h_a[6] = ''; _r_a[6] = ''; _i_a[6] = ''; _nl_a[7] = 7; _img_a[7] = 'nocontent5'; _h_a[7] = ''; _r_a[7] = ''; _i_a[7] = ''; _nl_a[8] = 8; _img_a[8] = 'nocontent5'; _h_a[8] = ''; _r_a[8] = ''; _i_a[8] = ''; _nl_a[9] = 9; _img_a[9] = 'nocontent5'; _h_a[9] = ''; _r_a[9] = ''; _i_a[9] = ''; _nl_a[10] = 10; _img_a[10] = 'nocontent5'; _h_a[10] = ''; _r_a[10] = ''; _i_a[10] = ''; _nl_a[11] = 11; _img_a[11] = 'nocontent8'; _h_a[11] = ''; _r_a[11] = ''; _i_a[11] = ''; _nl_a[12] = 12; _img_a[12] = 'nocontent8'; _h_a[12] = ''; _r_a[12] = ''; _i_a[12] = ''; _nl_a[13] = 13; _img_a[13] = 'nocontent8'; _h_a[13] = ''; _r_a[13] = ''; _i_a[13] = ''; _nl_a[14] = 14; _img_a[14] = 'nocontent8'; _h_a[14] = ''; _r_a[14] = ''; _i_a[14] = ''; _nl_a[15] = 15; _img_a[15] = 'nocontent8'; _h_a[15] = ''; _r_a[15] = ''; _i_a[15] = ''; _nl_a[16] = 16; _img_a[16] = 'nocontent6'; _h_a[16] = ''; _r_a[16] = ''; _i_a[16] = ''; _nl_a[17] = 17; _img_a[17] = 'nocontent6'; _h_a[17] = ''; _r_a[17] = ''; _i_a[17] = ''; _nl_a[18] = 18; _img_a[18] = 'nocontent6'; _h_a[18] = ''; _r_a[18] = ''; _i_a[18] = ''; _nl_a[19] = 19; _img_a[19] = 'nocontent6'; _h_a[19] = ''; _r_a[19] = ''; _i_a[19] = ''; _nl_a[20] = 20; _img_a[20] = 'nocontent6'; _h_a[20] = ''; _r_a[20] = ''; _i_a[20] = ''; var _nl_p2_a =new Array() var _img_p2_a =new Array() var _h_p2_a =new Array() var _r_p2_a =new Array() var _i_p2_a =new Array() var _A_p2_a =new Array() var _AC_p2_a =new Array() _nl_p2_a[1] = 1; _img_p2_a[1] = 'nocontent9'; _h_p2_a[1] = ''; _r_p2_a[1] = ''; _i_p2_a[1] = ''; _nl_p2_a[2] = 2; _img_p2_a[2] = 'nocontent9'; _h_p2_a[2] = ''; _r_p2_a[2] = ''; _i_p2_a[2] = ''; _nl_p2_a[3] = 3; _img_p2_a[3] = 'nocontent9'; _h_p2_a[3] = ''; _r_p2_a[3] = ''; _i_p2_a[3] = ''; _nl_p2_a[4] = 4; _img_p2_a[4] = 'nocontent9'; _h_p2_a[4] = ''; _r_p2_a[4] = ''; _i_p2_a[4] = ''; _nl_p2_a[5] = 5; _img_p2_a[5] = 'nocontent9'; _h_p2_a[5] = ''; _r_p2_a[5] = ''; _i_p2_a[5] = ''; _nl_p2_a[6] = 6; _img_p2_a[6] = 'nocontent7'; _h_p2_a[6] = ''; _r_p2_a[6] = ''; _i_p2_a[6] = ''; _nl_p2_a[7] = 7; _img_p2_a[7] = 'nocontent7'; _h_p2_a[7] = ''; _r_p2_a[7] = ''; _i_p2_a[7] = ''; _nl_p2_a[8] = 8; _img_p2_a[8] = 'nocontent7'; _h_p2_a[8] = ''; _r_p2_a[8] = ''; _i_p2_a[8] = ''; _nl_p2_a[9] = 9; _img_p2_a[9] = 'nocontent7'; _h_p2_a[9] = ''; _r_p2_a[9] = ''; _i_p2_a[9] = ''; _nl_p2_a[10] = 10; _img_p2_a[10] = 'nocontent7'; _h_p2_a[10] = ''; _r_p2_a[10] = ''; _i_p2_a[10] = ''; _nl_p2_a[11] = 11; _img_p2_a[11] = 'nocontent10'; _h_p2_a[11] = ''; _r_p2_a[11] = ''; _i_p2_a[11] = ''; _nl_p2_a[12] = 12; _img_p2_a[12] = 'nocontent10'; _h_p2_a[12] = ''; _r_p2_a[12] = ''; _i_p2_a[12] = ''; _nl_p2_a[13] = 13; _img_p2_a[13] = 'nocontent10'; _h_p2_a[13] = ''; _r_p2_a[13] = ''; _i_p2_a[13] = ''; _nl_p2_a[14] = 14; _img_p2_a[14] = 'nocontent10'; _h_p2_a[14] = ''; _r_p2_a[14] = ''; _i_p2_a[14] = ''; _nl_p2_a[15] = 15; _img_p2_a[15] = 'nocontent10'; _h_p2_a[15] = ''; _r_p2_a[15] = ''; _i_p2_a[15] = ''; _nl_p2_a[16] = 16; _img_p2_a[16] = 'nocontent2'; _h_p2_a[16] = ''; _r_p2_a[16] = ''; _i_p2_a[16] = ''; _nl_p2_a[17] = 17; _img_p2_a[17] = 'nocontent2'; _h_p2_a[17] = ''; _r_p2_a[17] = ''; _i_p2_a[17] = ''; _nl_p2_a[18] = 18; _img_p2_a[18] = 'nocontent2'; _h_p2_a[18] = ''; _r_p2_a[18] = ''; _i_p2_a[18] = ''; _nl_p2_a[19] = 19; _img_p2_a[19] = 'nocontent2'; _h_p2_a[19] = ''; _r_p2_a[19] = ''; _i_p2_a[19] = ''; _nl_p2_a[20] = 20; _img_p2_a[20] = 'nocontent2'; _h_p2_a[20] = ''; _r_p2_a[20] = ''; _i_p2_a[20] = ''; PLEASE PLEASE HELP ME FIGURE OUT HOW I CAN CUT THIS DOWN! It's been driving me insane for awhile now and I can't go any further until this is taken care of. I have created a page where everytime the page loads a popup window opens and diplays a message. This is done through javascripting. After the message is read the reader can close the window. The popup page is an actual html page and not a dialog box. This is fine except, everytime the visitor comes back to that page the window pops up. Is there a way to hve it where I can insert a link or button that says "Don't show message again" . That way it will pop up the first time but if the reader clicks that "Don't show message again" it will not appear again. Maybe set some sort of cookie. HELP ME PLEASE
Hello all, I made a fade script that will fade any element in or out. Works great on all browser I've tested but IE 7. With IE I have only tested this will IE 8 and IE 7. IE 7 the effect doesn't work. No error message or anything. I'm unsure what to do from here. I was hoping I could find some help here. Code: function fade(obj, duration, toggle) { steps = 1000; elem = document.getElementById(obj); function fadeIn() { for(var i = 0; i <= 1; i+=(1/steps)) { setTimeout("elem.style.opacity = "+ i +"", i * duration); setTimeout("elem.style.filter='alpha(opacity="+ i * 102 +")'", i * duration); } } function fadeOut() { for(var i = 0; i <= 1; i+=(1/steps)) { setTimeout("elem.style.opacity = "+ (1-i) +"", i * duration); setTimeout("elem.style.filter='alpha(opacity="+ (1-i) * 102 +")'", i * duration); } } /* One for Fade in and anything will be fade out*/ if(toggle == 1) { fadeIn(); } else { fadeOut(); } } Thanks, Jon W hello, I created this program to hold 5 cd's and some information relating to them. I keep getting an error that says: cannot find symbol symbol : class ButtonListener location: class inventoryprogram.InventoryProgram ActionListener btnListen = new ButtonListener(); // create listener here is the part of code with the actionlistener in it [CODE] private JPanel createButtonPanel() { // begin method createButtonpanel method ActionListener btnListen = new ButtonListener(); // create listener // create button objects JButton nextButton = new JButton("Display Cd"); // create and label button nextButton.setActionCommand("Next"); // action command for click nextButton.addActionListener(btnListen); nextButton.addActionListener(this); JPanel panel = new JPanel(); panel.add(nextButton); // add next button to panel return panel; // return panel } // end method createButtonPanel [ICODE] Hi all, I'm having trouble getting the following right: Code: <IMG border="0" onMouseOver=this.src="home2.gif" onMouseOut=this.src="home.gif" onClick=this.src="home2.gif" SRC="home.gif"> The idea is that after somebody clicks it, the button will remain home2.gif, but ofcourse if u mouseout after the click it will return to home.gif. Can somebody please help me with this problem?! I'm not really good at js, so I've been struggling with this for quite a few days ! Thnx alot! Sjaroow Hello. I am a new user. I have got a website, www.eastbourneinks.co.uk where the quantity buttons (+) & (-) do not work on most computers where I have had feedback. Is there any way of making them work on any/all computers. This is one of the pages: http://eastbourneinks.co.uk/product/...nk-cartridges/ Many thanks. Phil. I have the following buttons ... Code: <input id="newTaskButton" type="button" name="Good Morning" value="201" /> <input id="newTaskButton" type="button" name="Hello World" value="201" /> ... and the following javascript ... Code: <script type="text/javascript"> $(document).ready(function() { $("#newTaskButton").click(function() { alert(" " + document.getElementById("newTaskButton").name); }); }); </script> ... but I am having some trouble having the second button to response. My objective is to have 2 or more button that have the same click function (in this case, newTaskButton) but when clicked, it will produce different response. (in this case, the first button will response 'Good Morning' while the second button will response 'Hello World') Appreciate any help. Alternatives are welcome too. hello, Im trying to write a program when the user clicks on the button, the textbox should display "how are you ". This is what I tried : <html> <head> <title>"Click"</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <p> <input name="text1" type="text" id="text1" value="textbox 1" onFocus="this.style.background ='yellow'" onBlur="this.style.background='white'"> </p> <p> <input name="text2" type="text" id="text2" value="textbox 2" onFocus="this.style.background = 'yellow'" onBlur="this.style.background='white'"> </p> <p> <button onclick="textbox1.value="how are you">Click Me!</button> </p> </body> </html> To be clear my approach to coding is basically that of building some kind of Java Frakenstein's Monster... which also explains why everything I create invariably ends up in a windmill on fire... This is what I have managed to put together so far: Code: <script type="text/javascript"> var homeDown = new Array() homeDown[0] = "images/home001.png"; homeDown[1] = "images/home002.png"; homeDown[2] = "images/home003.png"; homeDown[3] = "images/home004.png"; homeDown[4] = "images/home005.png"; homeDown[5] = "images/home006.png"; homeDown[6] = "images/home007.png"; homeDown[7] = "images/home008.png"; homeDown[8] = "images/home009.png"; homeDown[9] = "images/home010.png"; homeDown[10] = "images/home011.png"; homeDown[11] = "images/home012.png"; homeDown[12] = "images/home013.png"; homeDown[13] = "images/home014.png"; homeDown[14] = "images/home015.png"; var homeOver = new Array() homeOver[0] = "images/image001.png"; homeOver[1] = "images/image002.png"; homeOver[2] = "images/image003.png"; homeOver[3] = "images/image004.png"; var x=0; function NormalImage() { document.getElementById("button1").src="images/home.png"; } function MouseOver() { document.getElementById("button1").src=homeOver[x]; x++; setTimeout("MouseOver()", 8); } function MouseDown() { document.getElementById("button1").src=homeDown[x]; x++; setTimeout("MouseDown()", 8); } </script> ...and the HTML: Code: <a href="http://www.google.com"> <img id="button1" src="images/home.png" onmousedown="MouseDown(button1)" onmouseover="MouseOver(button1)" onmouseout="NormalImage(button1)"/> </a> I'm sure that's probably the wrong way of doing it but it vaguely works. What I ultimately want is a button that will play the long image sequence on click and the shorter sequence on mouse over. However at the moment it appears that the states of the mouse being over and clicked are clashing so I need something to ignore mouseover images on click and another bit to reset the count on mouseover so it can play again. If I remove the mouseover event the animation on mousedown plays well, though I suspect it might be necessary to preload the images when it's online. Alternatively if anyone feels like writing a much easier bit of script that will do the same thing and slap me for being stupid that is acceptable too... |