JavaScript - Stuck On This Checkbox Code
This code is designed to send people either to List 1 or List 2 in the Aweber form.
At this time, I cannot make the uncheck go to List 2 to receive that thankyou email. Can you tell me what is wrong??? Check--Yes I would like to subscribe--List 1 email--thank you uncheck--No, I do not want to subscribe--List 2--you need more information I am omitting the top of the Aweber code before <body>-- <script language="javascript"> function magCheck(){ var magcheckbox = document.MainForm.magcheckbox.checked; if(magcheckbox == true){ document.getElementById("keylivingwell").value = '1355523361' document.getElementById("redirect").value = 'http://www.aweber.com/thankyou-coi.htm?m=text'; }else if(magcheckbox == false){ document.getElementById("keylivingwund").value = '1357528764' document.getElementById("redirect").value = 'http://www.aweber.com/thankyou-coi.htm?m=text'; } } </script> { } </style> <form method="post" class="af-form-wrapper" action="http://www.aweber.com/scripts/addlead.pl" > <div style="display: none;"> <input type="hidden" id="meta_web_form_id" name="meta_web_form_id" value="1355523361" /> <input type="hidden" name="meta_split_id" value="" /> <input type="hidden" name="listname" value="keylivingwell" /> <input type="hidden" name="redirect" value="http://www.aweber.com/thankyou-coi.htm?m=text" id="redirect_77879d6b0d1bc03d212e86d72e1eae3c" /> <input type="hidden" name="meta_adtracking" value="Key_to_Living_Well_in_Retirement" /> <input type="hidden" name="meta_message" value="1" /> <input type="hidden" name="meta_required" value="name,email" /> <input type="hidden" name="meta_tooltip" value="" /> </div> <div id="af-form-1355523361" class="af-form"><div id="af-header-1355523361" class="af-header"><div class="bodyText"><p> Yes, thank you, I would like</p> <p> a copy of the Report!</p></div></div> <div id="af-body-1355523361" class="af-body af-standards"> <div class="af-element"> <label class="previewLabel" for="awf_field-25981213">Name: </label> <div class="af-textWrap"> <input id="awf_field-25981213" type="text" name="name" class="text" value="" tabindex="500" /> </div> <div class="af-clear"></div></div> <div class="af-element"> <label class="previewLabel" for="awf_field-25981214">Email: </label> <div class="af-textWrap"><input class="text" id="awf_field-25981214" type="text" name="email" value="" tabindex="501" /> </div><div class="af-clear"></div> </div> <div class="af-element buttonContainer"> <input name="submit" id="af-submit-image-1355523361" type="image" class="image" style="background: none;" alt="Submit Form" src="http://www.aweber.com/images/forms/modern/blue/button.png" tabindex="502" /> <div class="af-clear"></div> </div> <div class="af-element privacyPolicy" style="text-align: center"><p><a title="Privacy Policy" href="http://www.aweber.com/permission.htm" target="_blank">We respect your email privacy</a></p> <div class="af-clear"></div> </div> <div class="af-element poweredBy" style="text-align: center; font-size: 9px;"><p>Powered by <a href="http://www.aweber.com" title="Email Marketing Services">AWeber</a> <a href="http://www.aweber.com" title="Email Marketing Services">Email Marketing Services</a></p> <div class="af-clear"></div> </div> </div> <div id="af-footer-1355523361" class="af-footer"><input id="magcheckbox" name="magcheckbox" onclick="magCheck();" type="checkbox" value="1" checked> <div class="bodyText"><p><span style="font-size: 14px;"> Yes, I would like to subscribe</span></p> <p><span style="font-size: 14px;"> to Baby Boomers Magazine.</span> </p></div></div> </div> <div style="display: none;"><img src="http://forms.aweber.com/form/displays.htm?id=jMysrKxMzMxsjA==" alt="" /></div> </form> <script type="text/javascript"> <!-- (function() { var IE = /*@cc_on!@*/false; if (!IE) { return; } if (document.compatMode && document.compatMode == 'BackCompat') { if (document.getElementById("af-form-1355523361")) { document.getElementById("af-form-1355523361").className = 'af-form af-quirksMode'; } if (document.getElementById("af-body-1355523361")) { document.getElementById("af-body-1355523361").className = "af-body inline af-quirksMode"; } if (document.getElementById("af-header-1355523361")) { document.getElementById("af-header-1355523361").className = "af-header af-quirksMode"; } if (document.getElementById("af-footer-1355523361")) { document.getElementById("af-footer-1355523361").className = "af-footer af-quirksMode"; } } })(); --> </script> I have looked at it so long time, I can't find it. Thanks for your help, Pat Similar TutorialsOk, I am in a small pickle here. I created a sidebar gadget for work originally with only 4 images that needed to cycle though it. Easy enough script done. Now they have 6 images that need to rotate through. Easy enough again, script done. The issue I have is now I have to re-push this updated html file to all 1000 PC's on my network. Plus every time a change is made I will have to do it again. And we change the images multiple times a month. So what I need help doing if its possible is to modify the html file i am listing below to have a second IF parameter that not only steps the image but also checks to see if the file is even there. This is the spot I need help at. Code: function slideit(){ if (!document.images) return document.images.slide.src=eval("image"+step+".src") whichimage=step if (step<10) step++ else step=1 I wanted to add another part to the IF statement like maybe. Code: If (step<10 && file_exists("http://www.akronlibrary.org/Gadget/Gadget Pic 1.bmp")) Basically a step that checks to see if I have at that moment a file named gadet pic 1. (I would do or statements for all of the file names) The point is to make this whole thing dynamic, so that I change image 1 on the server and every gadget on every PC looking for image 1 now see the new image. This way I just change the image file name when I want a different image to display. Same thing with the var for the slidelink function. points to a static named html file on my web server and I just change the redirect in the static named html file to go where i want it. I am by NO means a programmer, I am actually a network admin that came up with this idea and I am trying to fumble through it. Thanks in advance! Code: <html> <head> <meta hrrp-equiv="Content-Type" content="text/html; charset=Unicode" /> <style type="text/css"> body{ margin: 0px; width: 405px; height: 205px; font-family; Georgia; } </style> <script type="text/javascript"> var image1=new Image() image1.src="http://www.akronlibrary.org/Gadget/Gadget Pic 1.bmp" var image2=new Image() image2.src="http://www.akronlibrary.org/Gadget/Gadget Pic 2.bmp" var image3=new Image() image3.src="http://www.akronlibrary.org/Gadget/Gadget Pic 3.bmp" var image4=new Image() image4.src="http://www.akronlibrary.org/Gadget/Gadget Pic 4.bmp" var image5=new Image() image5.src="http://www.akronlibrary.org/Gadget/Gadget Pic 5.bmp" var image6=new Image() image6.src="http://www.akronlibrary.org/Gadget/Gadget Pic 6.bmp" var image7=new Image() image7.src="http://www.akronlibrary.org/Gadget/Gadget Pic 7.bmp" var image8=new Image() image8.src="http://www.akronlibrary.org/Gadget/Gadget Pic 8.bmp" var image9=new Image() image9.src="http://www.akronlibrary.org/Gadget/Gadget Pic 9.bmp" var image10=new Image() image10.src="http://www.akronlibrary.org/Gadget/Gadget Pic 10.bmp" </script> </head> <body> <a href="javascript:slidelink()"><img title="Akron-Summit County Public Library" name="slide" /></a> <script type="text/javascript"> var step=1 var whichimage=1 function slideit(){ if (!document.images) return document.images.slide.src=eval("image"+step+".src") whichimage=step if (step<10) step++ else step=1 setTimeout("slideit()",6000) } slideit() function slidelink(){ if (whichimage==1) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 1 Link.html" else if (whichimage==2) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 2 Link.html" else if (whichimage==3) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 3 Link.html" else if (whichimage==4) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 4 Link.html" else if (whichimage==5) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 5 Link.html" else if (whichimage==6) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 6 Link.html" else if (whichimage==7) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 7 Link.html" else if (whichimage==8) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 8 Link.html" else if (whichimage==9) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 9 Link.html" else if (whichimage==10) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 10 Link.html" } </script> </body> </html> I am trying to use some JavaScript code that I found by searching the web, my goal is to have a form with a "required" checkbox to force my users to acknowledge they have read my "Terms and Conditions" section. The code that I found ALMOST works properly - it does pop-up the "Alert" window when the checkbox is blank and the submit button is clicked... however, if the user closes the Alert window in order to click the checkbox in compliance, the "submit.form" command is executed before they have a chance. In other words, there is no "pause" in the execution of the script to allow the user to make the correction by clicking the checkbox. Here is the code: Code: <script LANGUAGE="JavaScript"> <!-- function ValidateForm(form){ ErrorText= ""; if ( form.terms.checked == false ) { alert ( "Please check the Terms & Conditions box." ); return false; } if (ErrorText= "") { form.submit() }} --> </script> Here is the HTML for the checkbox: Code: <input name="terms" type="checkbox" value="Yes" /> Here is the HTML for the submit button that calls the function: Code: <input type="submit" value="Continue" onclick="ValidateForm(this.form)" /> I've searched for other examples of code to accomplish this objective, but I'm hoping for a quicker solution by coming to the experts who can see the flaw in this JavaScript. Thanks for any help, Rob Hello everyone. I have been trying 2 days straight to figure out how to make this script work. Basically I am trying to have a hidden checkbox with a drop down menu. I want the user to be able to choose 0-9 where 0 the check box will not be checked and 1-9 if picked from the dropdown menu it will automatically check the hidden box. Here is the closest string of code I could find out there to help me figure it out but I am having no luck. The closest I got was....well I never really figured out how to make it work. Can someone please help me? Thanks. <script type="text/javascript"> function checkUncheck (selected) { var checkBox = document.getElementById("box"); if ((selected == 2) || (selected == 3)) { checkBox.checked = "checked"; } if ((selected == 0) || (selected == 1)) { checkBox.checked = "false"; } } </script> <form id="frm"> <table> <tr> <td><input type="checkbox" id="box" checked="false"/></td> <td> <select id="sel0" onchange="checkUncheck(this.selectedIndex)"> <option value="zero">zero</option> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> </select> </td> </tr> </table> </form> Hello everyone, my 1st post here and my 1st day with javascript! I am having some problems with the below script: Code: <html> <head> <title></title> <script type="text/javascript"> var electronics = ["mobiles", "hi-fi"]; var entertainment = ["books", "dvds",]; function check(checkboxid) { document.getElementById(checkboxid).checked = "checked"; } function visiblox(arrDiv, hs) { var disp = (hs) ? "none" : "block"; for(var x = 0; x < arrDiv.length; x++) { document.getElementById(arrDiv[x]).style.display = disp; } } function chk(what, item) { if(item) { visiblox(what, false); } else { visiblox(what, true); } } </script> <style type="text/css"> <!-- .hide { display: block; } .hide { display: none; } --> </style> </head> <body> <img src="images/electronics.png" onclick="check('electronics');"> <input type="checkbox" id="electronics" onchange="chk(electronics, this.checked);" > <br> <input type="checkbox" onclick="chk(entertainment, this.checked);"> Entertainment<br> <br> <br> <div id="mobiles" class="hide">Mobiles</div><br> <div id="hi-fi" class="hide">Hi-Fi</div><br> <div id="books" class="hide">Books</div><br> <div id="dvds" class="hide">DVD's</div><br> </body> </html> Basically what happens is, when you select a checkbox it displays the relevant divs, this works fine with the entertainment checkbox in the code. What I am trying to achieve is use an image to trigger the checkbox (which will be hidden) and the run the chk code to display the divs What actually happens when you click the image the checkbox does become checked, however the divs do not display, if I uncheck the checkbox itself and then check the actual checkbox then it works. Basically getting very frustrated as I can't seem to see whats wrong! I am guessing that for some reason the check code stops the chk running, but I dont know why! Many thanks for any help So here's what i want to do: i have 2 checkboxes, when Checkbox A is checked, i want to automatically check the checkbox B. When A is unchecked, then uncheck B how can i do that? thanks a lot ! Hi, If I have two check-boxes and one is already checked and then the is checked, how would I get it to uncheck the first one using JavaScript. Thanks, Cs1h No matter what I do, I have these two scripts, I really want on the same page 1. Is carouselGallery 2. Is flv player <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> <!-- body { text-align:center; margin-top: 100px; background-color: #111; } --> </style> <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript"> var flashvars = { imagesXmlPath: "" }; var params = { base: "", salign:"lt", menu:"false" }; var attributes = { }; swfobject.embedSWF("carouselGallery.swf", "myContent", "800", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes); </script></head> <body> <div id="myContent"> <h1>Alternative content</h1> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p> </div> </body> </html> Second Is <!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" lang="en" xml:lang="en"> <head> <title>FLV Player FlashVars Example</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="swfobject/swfobject.js"></script> </head> <body> <div id="myContent"> <h1>Please Upgrade Your Flash Player</h1> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p> </div> <script type="text/javascript"> var flashvars = { flvpFolderLocation: "flvplayer/", flvpVideoSource: "your_video_source", flvpWidth: "640", flvpHeight: "360" }; var params = { menu: "true", allowfullscreen: "true" }; swfobject.embedSWF("FLVplayer.swf", "myContent", "640", "360", "9.0.0", "swfobject/expressInstall.swf", flashvars, params); </script> </body> </html> Can someone please help me figure out how to get both to display on the page? Any help would be GREATLY appreciated. I'm just learning code. I did a small reaction game project. The idea is that the player is to click on only circles. It works unless a square comes up & is clicked on. My code is he Learning Javascript Here is the actual game: Learning Javascript Any help is appreciated! Hi! I'm new with javascript and jQuery in general. So if anyone could help me out it would be greatly appreciated. When the browser is finished loading I want #page2 to be loaded automatically. I can get it to work with: $(document).ready(function () { $('#page2').delay(200); $('#page2').show('slow'); }); But when I click on page2 (when first launched) it wants to load again. It seems like it doesn't understand #page2 is already loaded. I want it to do absolutely nothing when the user clicks on the page2 navigation button. I hope that I explained my problem correctly. Again, I'm a newbie at this and the fact that I got to this point is already a miracle. Thanks in advance! This is my code so far: $(document).ready(function () { $('#page2').delay(200); $('#page2').show('slow'); }); $(function(){ $('#content:not(.nav_block)>dt:not(.active) a,footer .privacy:not(.active) a[rel=privacy]').live('click',function(){ var next=this.rel=='privacy'? $('#privacy'):$(this).parent().next(), width=next.width(), parent=next.parent(), visible=parent.find('>dd:visible').css({overflow:'hidden'}) parent.addClass('nav_block') $('#content>dt,.privacy').removeClass('active') $(this).parent().addClass('active') if(this.rel=='privacy') $('#content>dt>a').removeClass('active').animate({opacity:0}) if(parent.css('left')!=0) next.parent().animate({left:0}) next.show().css({width:'64px'}).stop().animate({width:width+'px'},{ step:visible.length?function(now){ visible.width(width-now) }:'',complete:function(){ next.css({overflow:'visible'}) visible.css({width:width+'px'}).hide() parent.removeClass('nav_block') }}) return false }) <!-- THE PROBLEM SHOULD BE HERE, RIGHT ? --> $('.active a,#content.nav_block').live('click',function(){ return false }) Download the file: http://www.filedropper.com/testfile_1 I would love some help on this code I was assigned to debug...I never studied javascript nor have ever coded really, yet my boss(im volunteering at a company) is having me debug a website and I can't seem to figure this out. The problem is the menus stay expanded when the mouse is out, but when you activate the onMouseOver, it fixes it. Here is an extremely simplified version but it shows the problem. And I greatly appreciate any help I can get. Thanks in advance! Oh and I didn't write any of this + im a noob at coding so if the answer was explained with this in mind that'd be great! ----------- <!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" xml:lang="en" lang="en"> <!-- xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Yep</title> <link href="ReferenceFunctions.css" rel="stylesheet" type="text/css" /> <!--<script type="text/javascript" src="/offices/management_support/js/tab-view.js"></script>--> <!-- ************************ BEGIN Section 1 *************************************** --> <script type="text/javascript"> function ManageTabPanelDisplay() { // // Between the parenthesis, list the id's of the div's that // will be effected when tabs are clicked. List in any // order. Put the id's in single quotes (apostrophes) // and separate them with a comma -- all one line. // var idlist = new Array('tab1focus','tab2focus','tab3focus','tab1ready','tab2ready','tab3ready','content1','content2', 'content3'); // No other customizations are necessary. if(arguments.length < 1) { return; } for(var i = 0; i < idlist.length; i++) { var block = false; for(var ii = 0; ii < arguments.length; ii++) { if(idlist[i] == arguments[ii]) { block = true; break; } } if(block) { document.getElementById(idlist[i]).style.display = "block"; } else { document.getElementById(idlist[i]).style.display = "none"; } } } //SuckerTree Horizontal Menu (Sept 14th, 06) //By Dynamic Drive: http://www.dynamicdrive.com/style/ var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas function buildsubmenus_horizontal(){ for (var i=0; i<menuids.length; i++){ var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul") for (var t=0; t<ultags.length; t++){ if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon" } else{ //else if this is a sub level menu (ul) ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon" } ultags[t].parentNode.onmouseover=function(){ this.getElementsByTagName("ul")[0].style.visibility="visible" } ultags[t].parentNode.onmouseout=function(){ this.getElementsByTagName("ul")[0].style.visibility="hidden" } } } } if (window.addEventListener) window.addEventListener("load", buildsubmenus_horizontal, false) else if (window.attachEvent) window.attachEvent("onload", buildsubmenus_horizontal) </script> <!-- ************************ END Section 1 *************************************** --> <!-- ************************ BEGIN Section 2 *************************************** --> <script type="text/javascript"> <!-- *************Not sure why this is commented out ******** window.onload=montre; function montre(id) { var d = document.getElementById(id); for (var i = 1; i<=15; i++) { if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';} } if (d) {d.style.display='block';} } //--> </script> <!-- ************************ END Section 2 *************************************** --> <!-- ************************ BEGIN Section 3 *************************************** --> <script type="text/javascript"> function decide() { if (document.myca.search.value.length < 1) { window.alert ("Please enter a search keyword."); return false; } if (document.myca.whosearch[0].checked) { document.myca.sSearchString.value = document.myca.search.value; document.myca.submit(); } else { if (document.myca.whosearch[1].checked) { document.thissite[1].value = document.myca.search.value; document.thissite.submit(); } else { alert("You must select whether you want to search My CA or This Site."); } } return false; } </script> <!-- ************************ END Section 3 *************************************** --> <!-- ************************ BEGIN Section 4 *************************************** --> <script type="text/javascript"> <!--*************Not sure why this is commented out ********--> <!-- var defaultMainList = "Home"; function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function FP_swapImg() {//v1.0 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length; n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm; elm.$src=elm.src; elm.src=args[n+1]; } } } function FP_preloadImgs() {//v1.0 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array(); for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; } } function FP_getObjectByID(id,o) {//v1.0 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id); else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el; if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c) for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; } f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements; for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } } return null; } --> </script> <!-- ************************ END Section 4 *************************************** --> <!-- ************************ BEGIN Section 5 *************************************** --> <style type="text/css"> .blueLink { font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000066; font-size: 71%; } .Office_functions_sub_title { font-size: xx-small; color: #0066CC; } .style1 { font-size: small } .pixel_height { font-size: 5px; } .blank_menu_space_height { font-size: 5px; font-family: Arial; } .turquoise { color: #00FFCC } .blue_font { color: #0000FF; font-size: small; } body { margin-top: 0px; margin-bottom: 0px; } .style7 {color: #000066} .style10 {font-family: Verdana, Arial, Helvetica, sans-serif} .style11 { font-size: 12px } .style12 {font-size: 14px} .style13 {font-size: 65%} .style14 {font-size: 12px; color: #800000; } .style15 { color: #FFFFFF; font-weight: bold; font-size: small; } .style17 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #4d7fb2; font-weight: bold; } .style19 { font-family: "Times New Roman", Times, serif; font-size: 18pt; color: #FFFF00; } .style22 {font-size: 11px} </style> <!-- ************************ END Section 5 *************************************** --> </head> <body onload="FP_preloadImgs(/*url*/'images/button13.jpg', /*url*/'images/button4a.jpg'); MM_preloadImages('indeed.jpg' )"> <!--<body onload="MM_preloadImages('yep.jpg','yep.jpg')">--> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <!-- ************************ BEGIN Section 6 *************************************** --> <tr> <!--BEGIN Table Set-Up --> <!--CLOSE Table Set-Up --> </tr> <!-- ************************ END Section 6 *************************************** --> <!-- ************************ BEGIN Section 7 *************************************** --> <tr> <td style="height:17px"><div align="center" class="style15"> <table width="100%" border="1"> <tr> <td><div align="center">link</div></td> </tr> </table> </div></td> </tr> <!-- BEGIN Table Set-Up 1 --> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff"> <tr> <td valign="top" style="padding-left:12px; text-align:left; line-height:186%;"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff"> <!-- BEGIN Table Set-Up 2 --> <tr> <td rowspan="72" valign="top"><table border="0" cellspacing="0" cellpadding="0" style="background-color:#fff"> <!--BEGIN Example Office- Menut Table SET-UP--> <tr> <td valign="top" style="padding-right:12px"><table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="185" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="9px"></td> </tr> <tr> <td class="boxtitle style12">testings12345</td> </tr> <!-- BEGIN Sub-Section A thru C --> <tr> <td><div class="left_column_top"> <dl id="menu"> <!-- ************************ BEGIN Sub-Section A *************************************** --> <dt onmouseover="javascript:montre('smenu1');" onmouseout="javascript:montre();"> <a href="link.htm">link</a></dt> <!-- ************************ END Sub-Section A *************************************** --> <!-- ************************ BEGIN Sub-Section B *************************************** --> <dt onmouseover="javascript:montre('smenu2');" onmouseout="javascript:montre();"> <a href="link.htm">link</a></dt> <dd id="smenu2" onmouseover="javascript:montre('smenu2');" onmouseout="javascript:montre();"> <ul> <li><a href="link.htm"> link</a></li> <li><a href="link.htm"> link</a></li> <li><a href="link.htm"> link</a></li> <li><a href="link.htm">link</a></li> <li><a href="link.htm">link</a></li> </ul> </dd> <!-- ************************ END Sub-Section B *************************************** --> <!-- ************************ BEGIN Sub-Section C *************************************** --> <dt onmouseover="javascript:montre('smenu3');" onmouseout="javascript:montre();"> <a href="link.htm"> link</a></dt> <dd id="smenu3" onmouseover="javascript:montre('smenu3');" onmouseout="javascript:montre();"> <ul> <li><a href="link.pdf"> link</a></li> <li><a href="link.pdf"> link</a></li> <li><a href="link.pdf"> link</a></li> <li><a href="link.htm"> link</a></li> <li><a href="link.htm">link</a></li> <li><a href="link.htm"> link</a></li> <li><a href="link.htm"> link</a></li> <li><a href="link.htm"> link</a></li> <li><a href="link.htm"> link</a></li> </ul> </dd> <!-- ************************ END Sub-Section C *************************************** --> <dt onmouseover="javascript:montre('smenu4');" onmouseout="javascript:montre();"> <a href="ble.htm" style="line-height: 200%"> link<br /> link </a></dt> <dd id="smenu4" onmouseover="javascript:montre('smenu4');" onmouseout="javascript:montre();"> <ul> <li><a href="link233link.htm"> link</a></li> <li><a href="indeedy.htm"> link</a></li> <li><a href="training/linsks.htm"> link</a></li> </ul> </dd> <dt onmouseover="javascript:montre('smenu5');" onmouseout="javascript:montre();"> <a href="yep.htm"> link</a></dt> <dt onmouseover="javascript:montre('smenu6');" onmouseout="javascript:montre();"> <a href="indeed.htm"> link</a></dt> <dt onmouseover="javascript:montre('smenu7');" onmouseout="javascript:montre();"> <a href="thanks.htm"> link</a></dt> </dl> </div></td> </tr> <!-- CLOSE Sub-Section A thru C --> </table></td> </tr> <td><table width="185px" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="40px"></td> </tr> <tr> <td class="boxtitle style12">link</td> </tr> <!--BEGIN Sub-Section D thru F --> <tr> <td><div class="left_column_bottom" style="height:125px"> <dl id="menu"> <!-- ************************ BEGIN Sub-Section D *************************************** --> <dt onmouseover="javascript:montre('smenu10');" onmouseout="javascript:montre();"> <a href="yes.htm">link</a></dt> <dt onmouseover="javascript:montre('smenu11');" onmouseout="javascript:montre();"> <a href="yep.htm">random words</a></dt> <dt onmouseover="javascript:montre('smenu12');" onmouseout="javascript:montre();"> <a href="tests.htm"> <p style="line-height: 200%; margin-top: 1px; margin-bottom: 1px"> ble<br> mhm</p></a></dt> <dt onmouseover="javascript:montre('smenu13');" onmouseout="javascript:montre();"> <a href="communication/testsss.htm">Just some test</a></dt> <!-- ************************ END Sub-Section D *************************************** --> </dl> </div></td> </tr> <tr> <td > </td> </tr> <!--CLOSE Sub-Section D thu F --> </table></td> </tr> <tr> <td align="center"> <p align="center" id="legal"><!-- Original Template Designed by etc --> <a href="#heading"></a></p> </td> </tr> <!-- BEGIN Office Chief Table --> </table></td></tr> <!-- </td> SICR TAble --> <!-- </tr> CLOSE only TR Table Set-Up 2 --> </table> <p align="center"> </table> <!--CLOSE MAIN TABLE--> <a href="#heading"> Back to Top</a><br /> </td> </tr> </table> </td> </tr> <!-- CLOSE Table Set-Up 1 --> <!-- ************************ END Section 7 *************************************** --> </p> <tr> <td style="height:1px ;background-color:#CCCCCC"></td> </tr> </body> </html> I am learning JavaScript and found these tutorials at http://www.codecademy.com/courses/pr...#!/exercises/3 this is the one I got stuck on, I don't understand .. I just seem to have a block on what to do to this to make it change the while condition so that this do/while loop iterates 4 times like the tutorial wants me to do ... I have had to kill the page because it seems to be making a loop that messes w/ the browser and locks it up. ?? Code: var i = 4; do { console.log("This is iteration " + (i + 1) + "."); i++; } while( ); www.dreamdiamond.squarespace.com This is a website I'm building for a friend. Its very basic, as is my knowledge of web design, BUT, there is one important thing I cant seem to figure out before we register it as dreamdiamond.com! ok the code on THIS website : http://tablefilter.free.fr/ I cant seem to implement into the diamond website on the Inventory Page. We need to create a filterable table for spec. diamonds and this is driving me nuts. I tried uploading the .js files through the file storage, and put the java script code into the website settings>code injection> header No matter what it's not working though. Is there anyone who can help walk me through it? Or I can give someone the username/ pass so they can maybe help me set it up? Obv the pass would be changed afterwards LOL If you can help me out man I'll be forever grateful lol hi, im new to the html and javascript stuff and am coding my own site, and currently stuck. hope someone can help! for my website layout, i want to have 4-5 buttons on the left side for the different links, and on the right half i want to load that link without reloading the entire webpage. currently i have it so that everything is in tables, so table's left column contains the links (for example - Link1, Link2, Link3, Link4, Link5). now when i were to click any of those i want the page corresponding to that link to open up in the right column without reloading the entire page. i'm stuck on how to pass what i click on the left to load up on the right. any help would be nice! thanks ok guys im going to be honest here, i know nothing about javascript. ive been learning php and even that gets confusing at times. my issue: i bought a script off someone(php site) and it has a .php file that using .js files he had no idea how to fix the issue so im hoping you guys can help me fix it. this one .php page includes another .php file and 2 other .js files. i dont want to go and post every single file as one of them is like 1200 lines (i have if you like to hunt for errors) is there some code i can add in to make it show where its getting an error? i know you can in php and mysql the page get stuck on Loading... on the .php file which is line 647: AJS.setHTML(AJS.$('load'), 'Loading...') AJS.js & ocNewFixed.php (Starting page) all files can be downloaded he http://uppit.com/1233dylkbrfu/help.rar (too long to fit into 20k characters) Help would be appreciated. Hey everyone - got a Q... I'm having a tabbed panel where the 1st div is originally shown with display: block and the other 3 are display:none to hide, obviously. I want each div to have their own link where if you click the link for div 2 it hides the previous and shows that one etc. Here's what I originally have: Code: <script type="text/javascript"> function tab2() { document.getElementById('tab-content-2').style.display="block"; document.getElementById('tab-content-1').style.display="none"; } </script> <div id="tab-top"> <div class="tab-top-l"> </div> <div class="tab-top-main"> <ul> <a href="#" title="Lorem et"><li>Lorem et</li></a> <a href="#" title="Lorem et" onclick="tab2()"><li class="not-first">Lorem et</li></a> <a href="#" title="Lorem et"><li class="not-first">Lorem et</li></a> <a href="#" title="Lorem et"><li class="not-first">Lorem et</li></a> </ul> </div> <div class="tab-top-r"> </div> </div> <div id="tab-content-1" style="display: block;"> Content 1 </div> <div id="tab-content-2" style="display: none;"> Content 2 </div> <div id="tab-content-3" style="display: none;"> Content 3 </div> <div id="tab-content-4" style="display: none;"> Content 4 </div> That successfully hides tab 1 and shows tab 2 but I don't know how to do it properly so it hides the previously shown one. One tab should always be shown. Image attached to show what I mean. Can anyone tell me why? Here is the code: PHP Code: <html> <head> <title>clock</title> <style type="text/css"> <!-- body { color: #111111; font-family: Tahoma; font-size: 13px; } a { text-decoration:none; color:#222222; } a:hover { text-decoration:underline; } --> </style> <script type="text/javascript"> clock = { check:function(a){ return (a<10)? "0"+a : a }, show:function() { var time = new Date() var hours = this.check(time.getHours()) var minu = this.check(time.getMinutes()) var sec = this.check(time.getSeconds()) document.getElementById('time').innerHTML="Now the time is: " + hours + ":" + minu + ":" + sec setInterval("clock.show()",1000) }, }; </script> </head> <body onLoad="clock.show();"> <div id="time"></div> </body> </html> I adapted (well, attempted to, at least) a quote/testimonial rotation script to fit into my website. The script works PERFECTLY on Firefox but after making my modifications, I killed it in IE...and being a total n00b to JavaScripting.....I'm totally stumped. In Firefox, the script shows at the proper height. In Internet Explorer, the script is only shown at ~40 pixels and doesn't seem to be rotating through the different quotes (it still fades but it fades the same quote back and forth). The obvious question: HOW DO I FIX IT?!!? Original script was found at: http://www.caodesigns.com/blog/tutor....php?postID=33 My script is at: http://www.digitalctrl.org/help.html (right sidebar, in the "Testimonials" box). But something I want to know for future reference.......what is it that causes things to be formatted differently across browsers? This cross browser INcompatability is giving me grey hairs. I've been lurking around your community for a while now.....I hope you gents don't mind my first post being a question. If I need to reformat my post or do anything else to get assistance, please let me know so I can take care of it. Help! I am using a shopping cart solution that my clients had set up. The back end makes it close to impossible to upload my own files for use on the page IE .xml files, or any files other than images. The biggest problem is that the links they provide that lead to my product categories are text links, and they are heanous looking. I would like to spruce it up, throw the Product Category Links into a categorized drop down menu across the top. I am new to javascript and php and xhtml and coding in general. I NEED SOME HELP. Here is a copy of the header code where i assume i would place the drop down menu. <code> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title><ss:value source="$page.title"/></title> <link rel="icon" href="$store.images['favicon.ico']" type="image/x-icon"> <link rel="shortcut icon" href="$store.images['favicon.ico']" type="image/x-icon"> <ss:if test="$page.hasMetaDescription()"><META NAME="description" CONTENT="$page.meta.description"></ss:if> <ss:if test="$page.hasMetaKeywords()"><META NAME="keywords" CONTENT="$page.meta.keywords"></ss:if> <style type="text/css"> <!-- /* Style Sheet */ body { margin : 0px 0px 0px 0px; background-color:<ss:value source=$storeVersion.colorScheme.background/>; } .nav A:link {text-decoration:color:#000000} .nav A:visited {text-decoration:underline;color:#000000} .nav A:hover {text-decoration:none;color:#000000} .nav A:active {text-decoration:underline;color:#000000} .nav2 A:link {text-decoration:color:#000000} .nav2 A:visited {text-decoration:underline;color:#000000} .nav2 A:hover {text-decoration:none;color:#000000} .nav2 A:active {text-decoration:underline;color:#000000} .title {font-size:10pt;font-weight:bold;font-family:<ss:value source=$font.paragraph/> ;color:#000000;background-color:#FFCCCC;text-align:left;} .content {font-family:<ss:value source=$font.paragraph.face/> ;padding:8px 8px 8px 8px;text-align:left;} .nav {font-size:9pt;font-family:<ss:value source=$font.paragraph.face/> ;color:#000000;background-color:#FFCCCC;} .nav2 {padding:5px 5px 5px 5px;font-size:9pt;font-family:<ss:value source=$font.paragraph.face/> ;color:#000000;} .footer {font-size:9pt;font-family:<ss:value source=$font.paragraph.face/> ;color:<ss:value source=$font.paragraph.color/>;text-align:center;} --> </style> </head> <body bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table border="0" cellspacing="0" cellpadding="0" width="100%" > <tr> <td class="nav" valign="middle"> <font class="title"></font> <ss:if test="$storeVersion.storeLogoName"> <ss:link source="$storeVersion.homePage"><ss:image border="0" alt="" source="$storeVersion.storeLogo"/></ss:link> </ss:if> <ss:value source="$store.name"/> <font size="+0"></font></td> <td class="nav" valign="bottom" align="right"> <ss:link source="$storeVersion.catalog">Advanced Search</ss:link> | <ss:link source="$storeVersion.cart">View Cart</ss:link> | <ss:link source="$storeVersion.checkout">Checkout</ss:link> </td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="75%" > <tr> <td colspan="3"><ss:image border="0" alt="" width="1" height="1" source="$storeVersion.images['pixel.gif']"/></td> </tr> <tr> <td class="nav2" bgcolor="#ccff99" colspan="2"> <ss:if test="$storeVersion.templateExists('About Us')"> <ss:link source="$storeVersion.aboutUs">About Us</ss:link> </ss:if> <ss:if test="$storeVersion.templateExists('Customer Service')"> | <ss:link source="$storeVersion.customerService">Service</ss:link> </ss:if> <ss:if test="$storeVersion.templateExists('Store Policy')"> | <ss:link source="$storeVersion.storePolicies">Policies</ss:link> </ss:if> </td> <td class="nav2" bgcolor="#ccff99" align="right"> <ss:if test="$storeVersion.templateExists('Home Page')"> <ss:link source="$storeVersion.homePage">Home</ss:link> </ss:if> </td> </tr> <tr valign="top"> <td class="nav2" rowspan="2" width="140" background="$storeVersion.images['yellow.gif']"><ss:image border="0" alt="" width="20" height="14" source="$storeVersion.images['greenstream.gif']"/> <ss:image border="0" alt="" width="20" height="23" source="$storeVersion.images['pinkstream.gif']"/> <ss:image border="0" alt="" width="20" height="15" source="$storeVersion.images['bluestream.gif']"/> <form method="post" action="$storeVersion.searchResults"> Search <ss:button source="$storeVersion.images['go.gif']" alt="GO" border="0"/> <br /><input size="12" name="keyword" /> </form> <font size="6"><font face="Comic Sans MS"><strong>Products</strong><br /></font></font> <ss:foreach item="category" within="$catalog.categoryList()"> <ss:sortby item="categorypriority" direction="asc"/> <ss:if test="$category.treeLevel == '1'"> <ss:link source="$category"/><br /><ss:else /><span style="POSITION: relative; LEFT: 8px"><ss:link source="$category"/><br /></span> </ss:if> <font face="Comic Sans MS"></font> </ss:foreach> <p> </p> <ss:if test="$store.isFeatureEnabled('ShowAffiliateLink')"> <ss:link source="$storeVersion.affiliate">Become an Affiliate</ss:link><br /> </ss:if> <ss:if test="$store.isFeatureEnabled('ShowMembersOnlyLink')"> <ss:link source="$storeVersion.searchMembersOnly">Members Only Catalog</ss:link><br /> </ss:if> <ss:if test="$store.isFeatureEnabled('ShowStoreSubscriptionLink')"> <ss:link source="$storeVersion.subscribe">Become a Member</ss:link><br /> </ss:if> <ss:image border="0" alt="" width="140" height="300" source="$storeVersion.images['pixel.gif']"/> </td> <td class="content" width="100%"><br /><!-- header ends --> </code> That's the header code the dude with customer service told me that the sites werent generated in html, but that can't be entirely true can it? The guy was a duesche. So I guess what i really need to know is what do i need to move the <code> <ss:foreach item="category" within="$catalog.categoryList()"> <ss:sortby item="categorypriority" direction="asc"/> <ss:if test="$category.treeLevel == '1'"> <ss:link source="$category"/><br /><ss:else /><span style="POSITION: relative; LEFT: 8px"><ss:link source="$category"/><br /></span> </ss:if> <font face="Comic Sans MS"></font> </ss:foreach> <code/> To make that into an overhead drop down menu? I am a script kiddie noob, you are the greatest, you are smart and i am not, you are atrractive and i am ugly lol Thanks very much to who ever can possible help me! Hey I'm trying to use the adipose plugin to make rollover buttons, Everything works the first time around. I click on the button and it takes me to the link, but when I click on the 'back button' on the browser window, the rollover button stays in the hover state and stops working. Can you help please? Here is the link for that javascript, it's not gonna fit in he http://jobyj.in/adipoli/#download Hello, I have an expandable banner on my website. It starts out big and then after 5 seconds, the image gradually shrinks until is replace by a normal size banner. I one want this to happen once per visit. I've written a cookie, but I'm stuck on the last part. Granted I'm new to this, but I think I need to place this: Code: if ( getCookie('myCookie') != null ) return; setCookie('myCookie', 'ANY VALUE'); into this. But my question is where? I'm stuck and everyplace I stick it brings an error. Code: <img src="/lightbox1.jpg" alt="" id="banner"> <script type="text/javascript"> <script type = "text/javascript"> function setCookie(isName,isVal) { document.cookie = isName + "=" + isVal + ";expires=" + "path=/"; } function getCookie(isName){ cookieStr = document.cookie; startSlice = cookieStr.indexOf(isName+"="); if (startSlice == -1) {return null;} endSlice = cookieStr.indexOf(";",startSlice+1); if (endSlice == -1){endSlice = cookieStr.length} isData = cookieStr.substring(startSlice,endSlice) isValue = isData.substring(isData.indexOf("=")+1,isData.length); return isValue; function shrink() { if(banner.altered!='yes' && banner.width>50) { banner.width-=7; setTimeout("shrink()", 10); } else { banner.src=new_pic.src; banner.width=new_pic.width; banner.height=new_pic.height; banner.altered='yes'; } } var old_pic=new Image(); old_pic.src='/lightbox1.jpg'; var new_pic=new Image(); new_pic.src='/support.jpg'; var banner=document.getElementById('banner'); banner.onclick=shrink; setTimeout("shrink()", 5000); </script> Any help? |