JavaScript - Need Help For Simple Easyslider
hello
coding forums friends please help me i got stuck in sliding a slider that from easyslider. everything is ok when i individually browse from folder see here http://www.sajeebgroup.com/robin/easyslider/slider.php but when i tried to include in a divition in index.php page it do not slide but only one image is show see here right side news update div link is http://www.sajeebgroup.com/ what problem please help me i really going to frustrated to solve this. here is my index.php code with include of easy slide. index.php PHP Code: <?php include 'news/common/connection.php'; ?> <html> <head> <title>Welcome to Sajeeb Group</title> <style> .black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 150%; background-color: #000000; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { display: none; position: absolute; top: 55%; left: 23%; width: 50%; height: 50%; padding: 16px; border: 16px solid orange; background-color: white; z-index:1002; overflow: auto; } </style> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="swfobject.js"></script> <style type="text/css"> #ticker-container { position:relative; overflow:hidden; width: 170px; height: 200px; padding-top:10px; color:#000000; margin-top:8px; } #ticker { position:relative; width:150px; } </style> <script language="JavaScript"> function openit(link) { var url="./news/newsinfo.php?id="+link; window.open(url,"mywindow","resizable=0,scrollbars=1,height=400,width=400"); } //scroller width var swidth=170; //scroller height var sheight=205; //background color var sbcolor='#ccffff'; //scroller's speed var sspeed=3; var msg='' <?php $str="SELECT * from newsscroll ORDER BY news_id desc"; $res=mysql_query($str) or die("Error in selecting....."); while($dataNews=mysql_fetch_row($res)) { do{ echo "msg+=\"<ul><li><a href=# onclick=openit(\'".$dataNews[0]."\')><font size=2>".$dataNews[1]."</font></a></li><br></ul>\";"; }while($dataNews=mysql_fetch_row($res)); } ?> //End of your messages // Begin the ticker code var resumesspeed=sspeed function start() { if (document.all) iemarquee(ticker); else if (document.getElementById) ns6marquee(document.getElementById('ticker')); } function iemarquee(whichdiv){ iediv=eval(whichdiv) sheight += 50; iediv.style.pixelTop=sheight iediv.innerHTML=msg sizeup=iediv.offsetHeight ieslide() } function ieslide(){ if (iediv.style.pixelTop>=sizeup*(-1)){ iediv.style.pixelTop-=sspeed setTimeout("ieslide()",100) } else{ iediv.style.pixelTop=sheight ieslide() } } function ns6marquee(whichdiv){ ns6div=eval(whichdiv) sheight += 50; ns6div.style.top=sheight + "px"; ns6div.innerHTML=msg sizeup=ns6div.offsetHeight ns6slide() } function ns6slide(){ if (parseInt(ns6div.style.top)>=sizeup*(-1)){ theTop = parseInt(ns6div.style.top)-sspeed ns6div.style.top = theTop + "px"; setTimeout("ns6slide()",100) } else { ns6div.style.top = sheight + "px"; ns6slide() } } </script> <script type="text/javascript" src="swfobject.js"></script> <script language="JavaScript" type="text/JavaScript"> <!-- 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_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_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_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];} } //--> </script> <style type="text/css"> <!-- .gallery { zoom:1; width:520px; } --> </style> <script type="text/javascript">var LightBoxOpt={autoPlay:false}</script> <link rel="stylesheet" href="engine/css/lightbox.css" type="text/css" media="screen" /> <script src="engine/js/prototype.js" type="text/javascript"></script> <script src="engine/js/scriptaculous.js?load=effects,builder" type="text/javascript"></script> <script src="engine/js/lightbox.js" type="text/javascript"></script> <style> .gallery { zoom:1; width:700px; } .gallery a { display: block ; float:center; margin:5px; padding:5px; height: 150px; border:solid 1px #b8b8b8; background-color:#FFFFFF; opacity:0.87; alignment: center; } .gallery a:hover { opacity:1; } .gallery a img { border:none; display:block; } .gallery a#vlightbox{display:none} .gallery1 { zoom:1; width:520px; } .gallery2 { zoom:1; width:520px; } .gallery3 { zoom:1; width:520px; } .gallery4 { zoom:1; width:520px; } .gallery5 { zoom:1; width:520px; } .gallery6 { zoom:1; width:520px; } .gallery7 { zoom:1; width:520px; } .gallery8 { zoom:1; width:520px; } .gallery9 { zoom:1; width:520px; } .gallery10 { zoom:1; width:520px; text-align:center; } .style1 {font-family: Arial, Helvetica, sans-serif} .style3 {font-size: 12px} .gallery11 { zoom:1; width:520px; } .gallery12 { zoom:1; width:520px; } .gallery13 { zoom:1; width:520px; } .gallery14 { zoom:1; width:520px; } .gallery15 {zoom:1; width:520px; } .gallery15 { zoom:1; width:700px; } .gallery111 {zoom:1; } .gallery121 {zoom:1; } .gallery131 {zoom:1; } .gallery1111 {zoom:1; } .gallery1311 {zoom:1; } .gallery13111 {zoom:1; } #link_style { text-decoration:none; color:#000000;} </style> </head> <body background="images/wr_body.gif" 'images/btn%20import%20over.gif','images/btn%20contact%20over.gif','images/btn%20home%20over.gif','images/btn%20link4%20over.gif')"> <div align="center"> <table cellpadding="0" cellspacing="0" width="775" height="107"> <!-- MSTableType="layout" --> <tr> <td valign="top" width="258"> <img border="0" src="images/head logo.gif" width="258" height="107"></td> <td valign="top" height="107" width="517"> <img border="0" src="images/head right.gif" width="517" height="107"></td> </tr> </table> </div> <div align="center"> <table cellpadding="0" cellspacing="0" width="775" height="798"> <!-- MSTableType="layout" --> <tr> <td width="775" height="798" valign="top"> <div id="FlashMenuLabs"> You need to upgrade your Flash Player or to allow javascript to enable Website menu.</br> <a href="http://www.adobe.com/go/getflashplayer">Get Flash Player</a> </div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("menu.swf", "menu", "774", "35", "8", "#000000"); so.addParam("wmode", "transparent"); so.addParam("scale", "noscale"); so.addParam("salign", "TL"); so.write("FlashMenuLabs"); // ]]> </script> <table cellpadding="0" cellspacing="0" width="775" height="223"> <!-- MSTableType="layout" --> <tr> <td width="775" height="223" valign="top"> <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="774" height="223"> <param name="movie" value="body anim.swf"> <param name="quality" value="High"> <embed src="body%20anim.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="774" height="223"></object> </td> </tr> </table> <table cellpadding="0" cellspacing="0" width="775" height="232" id="table1"> <!-- MSTableType="layout" --> <tr> <td valign="bottom" background="images/welcome%20bg.gif"> <div align="right"> <table cellpadding="0" cellspacing="0" width="370" height="180"> <!-- MSTableType="layout" --> <tr> <td background="images/welcome%20text%20bg.gif" height="180" width="370"> <div align="center"> <table cellpadding="0" cellspacing="0" width="346" height="159"> <!-- MSTableType="layout" --> <tr> <td width="346" height="159" valign="top" style="text-align:justify;"> <font face="Verdana" size="2" color="#203E59"> </font></td> </tr> </table> </div> </td> </tr> </table> </div> </td> <td></td> <td valign="top" height="230" background="images/news%20bg.gif"> <body onload="start();"> <div id="ticker-container" onmouseover="sspeed=0;" onmouseout="sspeed=resumesspeed"> [COLOR="Red"]here i want to include slide <div id="ticker"> <?php include("robin/easyslider/slider.php"); ?> </div> </div>[/COLOR] </div> </div> </td> </tr> <tr> <td width="563"></td> <td width="3"></td> <td height="2" width="209"></td> </tr> </table> </div> <div align="center"> <table cellpadding="0" cellspacing="0" width="775" height="230" id="table2"> <!-- MSTableType="layout" --> <tr> <td valign="top" background="images/divisions-bg.gif" rowspan="2" width="563"> <div align="center"> <table cellpadding="0" cellspacing="0" width="549" height="169" style="text-align:left;"> <!-- MSTableType="layout" --> <tr > <td valign="top" height="32" colspan="2"> <p style="margin-left: 10px; margin-top: 10px"><b> <font size="2" face="Verdana" color="#203E59">Group Capability</font></b></td> </tr> <tr> <td height="137" width="279" valign="top"> <ul> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/sajeeb-group.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Sajeeb Corporation</a></span></font> </li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/sajib-agro.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;" >Sajeeb Agro Limited</a></span></font> </li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <a href="http://www.ststelecomltd.com/" style="text-decoration: none"> <font color="#203E59">STS Telecom Limited</font></a></font></li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/hashem-auto.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Hashem Auto Rice Mill</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/chittagong-enamel.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Chittagong Enamel & Aluminium Works Ltd.</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/sajeeb-industries.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Sajeeb Industrial Corporation</a></span></font></li> </ul> </td> <td height="137" width="270" valign="top"> <ul> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <span class="gallery1111"><a href="homepage/Hasem-foods.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Hashem Foods Limited</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <span class="gallery1111"><a href="homepage/sajib-home.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Sajeeb Homes Limited</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <span class="gallery1111"><a href="homepage/mermaid.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Mermaid Sweater Ltd.</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <a href="http://www.takaful.com.bd/" style="text-decoration: none"> <font color="#203E59">Takaful Islami Insurance Limited </font></a></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"><a href="http://www.ststelecomltd.com/" style="text-decoration: none" target="_self"><font color="#203E59">STS Telecommunications (M) Sdn Bhd</font></a></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"><a href="http://www.ststelecomltd.com/" style="text-decoration: none" target="_self"><font color="#203E59"> Meghna Insurance Company Ltd. </font></a></font></li> </ul> </td> </tr> </table> </div> </td> <td></td> <td valign="middle" height="115" background="images/message%20bg.gif"> <div align="right"> <table cellpadding="0" cellspacing="0" width="180" height="99"> <!-- MSTableType="layout" --> <tr> <td width="180" height="99" valign="middle"> <p align="justify" style="margin-left: 5px; margin-right: 8px"> <font size="1" face="Verdana" color="#203E59">Welcome you all in the world of �Sajeeb group of Companies� to get the taste of modernization and continuous improvement in the business arena of Bangladesh. (<a href="message.php"><font color="#224562">Read More>></font></a>)</font></td> </tr> </table> </div> </td> </tr> <tr> <td width="3"> <p style="margin-top: 2px; margin-bottom: 2px"></td> <td valign="bottom" height="115" background="images/webmail%20bg.gif" width="209"> <div align="right"> <table cellpadding="0" cellspacing="0" width="180" height="100"> <!-- MSTableType="layout" --> <tr> <td width="180" height="100" valign="middle"> <form method="POST" action="http://sajeebgroup.com:2096/login/" style="text-align:right; padding-right:4px;"> <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --> <p style="margin-left: 5px; margin-right: 3px; margin-top: 2px; margin-bottom: 2px"> <b><font face="Verdana" size="1" color="#203E59"> Email : </font></b> <font color="#203E59"> <input name="user" type="text" id="user" size="12"> </font></p> <p style="margin-left: 5px; margin-right: 3px; margin-top: 2px; margin-bottom: 2px"> <b><font face="Verdana" size="1"> <font color="#203E59">Password:</font> </font></b> <input name="pass" type="password" id="pass" size="12"> <input type="submit" value="Login" name="B1" style="margin-top:2px;"> </p> </form> </td> </tr> </table> </div> </td> </tr> </table> </div> <table cellpadding="0" cellspacing="0" width="775" height="90"> <!-- MSTableType="layout" --> <tr> <td width="775" height="90" valign="middle"> <table cellpadding="0" cellspacing="0" width="775" height="79"> <!-- MSTableType="layout" --> <tr> <td background="images/bottom%20bg%20home.gif" valign="bottom" height="79" width="775"> <table cel Similar TutorialsHi all hope i can get a response - would like to be able to make my thumbnails link to the correct image inside easyslider so when the link is clicked the images jumps to the correct slide please look at the website to get what i mean - at the moment all links just go to the first slide, any help would be really appreciated www.seunshotephotography.com have no clue how to do this and getting really frustrated On a friend's site I am using a combination of easyslider (a slideshow script) and lytebox (probably doesn't need an intro). It can be seen in action on http://www.maisonportier.com/menu.php (then click on 'Press'). I really don't know much about Javascript so am just able to do extremely simple things such as combining two script. Now my friend want the slideshow to pause when an image is opened (using Lytebox), and to continue when the image is closed. The scripts can be found at: http://www.maisonportier.com/js/lytebox.js and http://www.maisonportier.comeasySlider1.5.js Can anybody tell me how to modify the code? Any help is greatly appreciated! Hi all, I have created the following page http://www.kylehouston.com/testing/cci/ When loading in ie6 and ie7 the content slider exposes all the slides until fully loaded, is it possible to hide these slides while loading? Thanks in advance Kyle I imagine this would be very simple for someone who knows javascript. I want to have three fields. First field is "posted speed limit", second field is "actual speed" and third field will be the output field. All the script needs to do it subtract the posted speed from the actual speed and add a ZERO to the end; which is the amount of the speeding ticket. The minimum fine is $100, however. So, 5 miles over the speed limit would be $100 (minimum value) 15 miles over the speed limit would be $150 (add a zero) 35 miles over the speed limit would be $350. etc. I know very little Javascript, if anyone could help me out with this, I'd appreciate it. Thanks, Sean Hi Folks, I've been trying to learn Javascript, I'm fluent with CSS, HTML and not to bad with jQuery and PHP. But I've been trying to learn the core fundamentals of JavaScript. Basically, I have a friend who has a strange take on the English language, so I wanted to make him a translator, so that you could input one of his misspellings and it would bring up the proper word. <html> <head> <script type="text/javascript" src="js/modernizr.js"></script> <script type="text/javascript"> // Mox spellings function checkMox () { var bm = document.forms["transMox"]["mox"].value; if (bm == "wid") { document.write("wid = with"); } else { document.write("Please enter a Moxism"); } }; </script> </head> <body> <header> <div id="title"> <h1>I drink!</h1> <h2>Therefor I am...</h2> </div> <nav> <ul> <li>The history of Moxisms</li> <li>Examples of Moxisms</li> <li>The man himself...</li> </ul> </nav> </header> <h3>Welcome to the Big Mox translator</h3> <form id="transMox" action="#output" method="post" onsubmit="return checkMox()"> <input type="text" id="mox">Enter a Moxism</input> <br /> <input type="submit" id="submit" onSubmit="checkMox();">G0!</input> </form> <div id="output"> </div> </body> </html> Obviously that's just for one word, so I wondered how to structure more words into an array or something? Anyway, cheers in advance for the help guys! Hi, Im trying to make an imacro/javascript script that checks a webpage for names, and if either of the names are found, i want the script to alert me, if not, continue looping/reloading the page. Im not at all good with javascript, imacro is more sort of my thing, however what i do have, doesnt seem to do anything. var links = document.getElementsByTagName('a'); for (var i in links){ if (links[i].value == "Simon" || links[i].value == "James"){ alert("ATTENTION"); } } i dont know if its something simple i'm missing, or whether im nowhere near, but ive spent all day trying to do this, and lost all patience. Any suggestion/fixes? Hello, Below is my Javascript, CSS and HTML code for the navigation menu on http://033691f.netsolhost.com/stnew/ -- a test site for my company. Note: I did not write the Javascript code nor do I know how to write javascript. I take no credit. When the page first opens, the navigation shows fully expanded for a second, then collapses all. I would like to cut out the expanded view if possible and have the page load with the menu fully collapsed. Is there any way that would work? Thank you in advance for any input! Code: function initMenus() { $('ul.menu ul').hide(); $.each($('ul.menu'), function(){ var cookie = $.cookie(this.id); if(cookie === null || String(cookie).length < 1) { $('#' + this.id + '.expandfirst ul:first').show(); } else { $('#' + this.id + ' .' + cookie).next().show(); } }); $('ul.menu li a').click( function() { var checkElement = $(this).next(); var parent = this.parentNode.parentNode.id; if($('#' + parent).hasClass('noaccordion')) { if((String(parent).length > 0) && (String(this.className).length > 0)) { if($(this).next().is(':visible')) { $.cookie(parent, null); } else { $.cookie(parent, this.className); } $(this).next().slideToggle('normal'); } } if((checkElement.is('ul')) && (checkElement.is(':visible'))) { if($('#' + parent).hasClass('collapsible')) { $('#' + parent + ' ul:visible').slideUp('normal'); } return false; } if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $('#' + parent + ' ul:visible').slideUp('normal'); if((String(parent).length > 0) && (String(this.className).length > 0)) { $.cookie(parent, this.className); } checkElement.slideDown('normal'); return false; } } ); } $(document).ready(function() {initMenus();}); Code: <ul id="menu1" class="menu" style="margin-top:20px;"> <li><a class="m0" href="index.php" style="background-color:#222; color:#fff;">HOME</a></li> <li><a class="m1" href="">WHO WE ARE ...</a> <ul><li><a href="">Company Overview</a></li> <li><a href="">Clientele</a></li> <li><a href="">Multimedia</a></li> <li><a href="">Careers</a></li> <li><a href="">Contact Us</a></li> </ul> </li> <li><a class="m1" href="">WHAT WE DO ...</a> <ul><li><a href="">Promotional Products</a></li> <li><a href="">Screen Printing</a></li> <li><a href="">Embroidery</a></li> <li><a href="">Signage</a></li> <li><a href="">Web Design</a></li> </ul> </li> <li><a class="m3" href="">FIND PRODUCTS ...</a> <ul><li><a href="">Web Search</a></li> <li><a href="">Online Catalogs</a></li> </ul> </li> <li><a class="m4" href="">SUPPORT TOPICS ...</a> <ul><li><a href="">General Information</a></li> <li><a href="">Available Brands</a></li> <li><a href="">Artwork Submissions</a></li> <li><a href="">Color & Substrate Charts</a></li> <li><a href="">Dartman Game</a></li> </ul> </li> <li><a class="m5" href="http://www.screentek.net/blog">READ OUR BLOG</a></li> </ul> Code: ul.menu { border-bottom:1px solid #ccc; } ul.menu, ul.menu ul { list-style-type:none; margin: 0; padding: 0; width: 240px; } ul.menu a { display: block; text-decoration: none; } ul.menu li { margin-top: 0px; border-top:1px solid #ccc; font-size:10pt; font-family: Segoe-B; } ul.menu li a { background: #fff; color: #333; padding: 3px 20px; } ul.menu li a:hover { background: #2b76b7; color:#fff; } ul.menu li ul li a { background: #fff; color: #2b76b7; padding-left: 35px; font-size:10pt; font-family: Segoe-R; } ul.menu li ul li a:hover { background: #eee; border-left: 5px #000 solid; padding-left: 25px; color:#333; } .code { border: 1px solid #ccc; list-style-type: decimal-leading-zero; padding: 5px; margin: 0; } .code code { display: block; padding: 3px; margin-bottom: 0; } .code li { background: #ddd; border: 1px solid #ccc; margin: 0 0 2px 2.2em; } .indent1 { padding-left: 1em; } .indent2 { padding-left: 2em; } .indent3 { padding-left: 3em; } .indent4 { padding-left: 4em; } .indent5 { padding-left: 5em; } I have very limited understanding of programming, but I want to do something with javascript in the browser and don't know how to go about it. I know it could be done in C or some other language, but I have even less experience with that, so I want to see if I can do it in the browser. I have a questionnaire that the respondents filled out by hand, and I have to tally the results. Rather than go through and tally up the results for each question by hand on paper, I'd rather just be able to punch the values for the answers (the questions are "worst to best; 1-5" type responses) on the 10-key, have it add 1 to the appropriate box for each question, move to the next question, wait for my next entry of 1-5, and start back at the beginning again when I'm finished inputting answers for all the questions. I have an idea that there'd be 5 boxes per question for the tallied results and a box alongside each of those for entry of the answer. If you input "1" in that box, it'd add 1 to the first box; if you hit "2," it'd add 1 to the second box; if you hit "3," it'd add 1 to the third box, etc. I know this probably requires onKeyDown or onKeyUp to get the value of the answer, but I'm not sure how to get values captured from onKeyDown/Up through the javascript and back into the appropriate boxes. I'm not sure if I need an if...then conditional in the javascript or if it can be done some other way. Anyway, can anyone post some simple, sample code so I can get this going for at least one question and then I can scale it up from there? Thank you! Hi, I need a very simple script that will do the following : I have a HTML form. I have an input call "title". Say I wrote "fleur-de-lys" I have a text area call "text" When I hit the submit button I want to do : 1. Create a HTML webpage with the name in input : fleur-de-lys.html 2. Add the text in "text" somewhere in the body of that new file fleur-de-lys.html 3. Add a preview of that text somewhere in my index page Basically it's like you post a new article on wordpress or whatever, but I just want something simple no database and just need help on how I do this. Thank you very much Hi, I am trying to create a radio button that when clicked shows a table. IF you can recommend a way to do it without Javascript that would be MOST helpful. Otherwise here is what I've got so far: [CODE]<input type="radio" name="product" onclick="OnProductClick(this)" value="Stats" />Statistics <input type="radio" name="product" onclick="OnProductClick(this)" value="Tradinghistory" /> Trading History </p> <script type="text/javascript"> var c = true; var b = true; function OnProductClick(product) { if ((c) && (product.value == "Stats")) { document.getElementById('St').style.display = "block"; c = false; b = true; } else if ((b) &&(product.value == "Tradinghistory")) { document.getElementById('TrdH').style.display = "block"; c = true; b = false; } } </script>[CODE] Where St and TrdH are 2 seperate div ids for 2 different tables. Please Help. Many Thanks Hey guys! I need a simple JavaScript word translator where the user can type a sentence into a text box and then be presented with what they just typed in on the page but with any programmed word replacements. I want to be able to programme in the words myself for replacement so no Google; this will be a personal offline thing and isn't used to translate a language. For example, if I programmed the word " chocolate " to be replaced with " strawberry ", and " a lot " to be replaced with " loads ", and typed into the text-box: "I like chocolate sauce a lot ". It would then display the sentence on the page, but with the word alterations. Therefore looking like this: "I like strawberry sauce loads ". That being just an example. I want to be able to easily add additional word replacements without hassle using only JavaScript, I don't want it to translate the text on the page or anything, just what you type into the text-box. So let's pretend the words were programmed as follows: . cat = dog, . love = adore . very much = a lot And I typed into the text-box the following: "I have a cat, and I love her very much. " On the same page, it would then display this text: "I have a dog, and I adore him a lot. " I cannot use other code as I am only fond with JavaScript. I would need the text-box to automatically be selected by default everytime the page is loaded, and then for it to clear everytime you click 'Submit' or press the [Enter] key, ready for the next sentence to be typed in. I know this is a lot to ask but I didn't know who else to turn to. Anyways, I know you'll know this WAY better than me, ha; hope you can help! Cheers guys!!! Hey guys, I'm new to jquery and I'm sure this is a VERY simple problem.. Here's my code Quote: <style type="text/css"> #box { background: red; width: 300px; height: 300px; display: none; } </style> <script type="text/javascript"> $(function() { $('a').click(function() { $('#box').slideDown(4000); }); }); </script> </head> <body> <div id="box"></div> <a href="#">Click Me!</a> </body> </html> As you can see it's pretty simple, I've made the box slideIn. My problem is I want to make a separate button to slide it back out, but because I've used the "a" tag it's associating all links with the same function, how do I get around this? I'm sure it's really simple! Thanks I have been having problems adding checkboxes and option selects in the same function.. Here's what I have. Code: <script type="text/javascript"> function bonuscalc() { var aaaa = document.getElementById("aaaa").value; var bbbb = document.getElementById("bbbb").value; var cccc = document.getElementById("cccc").value; if (dddd.checked){ var dddd = document.dddd.value = 2; } else { var dddd = document.dddd.value = 1; } var eeee = document.getElementById("eeee").value; var bonus = aaaa* bbbb * dddd * cccc * eeee; var roundbonus = Math.round(bonus*10)/10; document.getElementById("roundbonus").value = roundbonus; } </script> Javascript first.. The part I'm not sure about is the if/else part for checbox. Now the html: Code: <form action="" id="calc1"> <table width="100%"> <tbody> <tr> <td>A status: <select id="aaaa"> <option value="1.1">A1</option> <option value="1.02">A2</option> <option value="1">A3</option> <option value="0.95">A4</option> </select> </td> <td>B status: <select id="bbbb"> <option value="1">0%</option> <option value="0.99">1%</option> <option value="0.98">2%</option> <option value="0.97">3%</option> <option value="0.96">4%</option> <option value="0.95">5%</option> <option value="0.94">6%</option> <option value="0.93">7%</option> <option value="0.92">8%</option> <option value="0.91">9%</option> <option value="0.90">10%</option> </select> </td> <td>E status:<input id="eeee" type="text" /> </td> <td>D status: <input id="dddd" name="dddd" type="checkbox"> </td> <td>C status: <select id="cccc"> <option value="1">No</option> <option value="1.2">Yes</option> </select> </td> </tr> <tr> <td width="100%"> <input type="button" value="Submit" onclick="bonuscalc()" /> <br /> Result: <input type="text" readonly="readonly" id="roundbonus" /> </td> </tr> </tbody> </table> </form> I hope it's not too confusing. The idea is to assign value 2 if the checkbox is checked and value 1 is it isn't.. hi guys i am pretty new to javascript and i'm having trouble with this code: Code: <HTML> <HEAD> <TITLE></TITLE> <SCRIPT LANGUAGE = "JAVASCRIPT"> var recipient; // Declare other variables here recipient = window.prompt('Please enter the name of the recipient', ''); // Prompt for other values here // Output the customised greeting here </SCRIPT> </HEAD> <BODY> </BODY> </HTML> What I need it to do is pop up with 3 input boxes. 1 for the reciever, 1 for the occasion (e.g. birthday ect) and another from the sender. and i need to be able to show it in the browser too. I am trying to use document.get to change the style of a class. The CSS is: PHP Code: .jewelToggler{background:no-repeat url(/rsrc.php/z7VU4/hash/66ad7upf.png);display:inline-block;height:31px;position:absolute;text-decoration:none;width:24px} and the HTML is such: PHP Code: <a class="jewelToggler" id="jewelRequest" title="Friend requests" href="http://www.facebook.com/reqs.php" onclick="var toggle = function() {this.onclick = function(e) {e = e || window.event;e && Event.prevent(e);Jewel.toggle(this, "[fb]requests");}.bind(this);this.onclick();}.bind(this);this.onclick = function() {CSS.toggleClass(this.parentNode, 'openToggler');return false;}.bind(this);this.onclick();onloadRegister(toggle);return false;" accesskey="3"><span class="jewelCount"><span id="jewelRequestCount">0</span></span></a> mainly focusing on [a class="jewelToggler"] So naturally I assumed that his javascript would work: PHP Code: document.getElementById('jewelToggler').getElementsByTagName("a")[0].style.backgroundImage="url('myimgurl')"; But it doesn't change anything. Comments? Ideas? Thanks. Hello, I am new to javascript. Below is the code that opens a new window when the user clicks on the button "Click here to see". But the code resides outside the <script></script>. As far as i know javascript codes have to be between these tags to work. How will the "window.open" statement work? Code: <form> <input type="button" value="Click here to see" onclick="window.open('http://www.yahoo.com')" /> </form> Please help if you can. My problem is that i have simple paypal form. When user select 10 accounts then below textbox shows amount to be paid. But when i click at paypal it again multiply with accounts and shows multiple amount at paypal page. For example if you select 10 then amount will be 18.5$ but after clicking at pay button it shows amount at paypal page $185.00 Code: <body> <form name="frm1" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="accounts@freelanceswitch.com"><br /> <strong>How Many Acounts you want</strong> <select name="quantity" onchange="calculate()" id="quantity"> <option value="5">5</option> <option value="10">10</option> <option value="15">15</option> <option value="20">20</option> <option value="25">25</option> <option value="30">30</option> </select> <br /> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="lc" value="AU"> <input type="hidden" name="bn" value="PP-BuyNowBF"> <input type="hidden" name="return" value="http://net.tutsplus.com/payment-complete/"> <br /> <p>$ <input type="text" name="amount" id="amount" value="0" readonly="readonly"/> <br /> <input type="submit" value="Pay with PayPal!"> </p> </form> <script type="text/javascript"> function calculate (){ ac=document.getElementById('quantity').value; var z=1.85; total =ac*z; document.frm1.amount.value=total; } </script> </body> Hello all, I have a translation script that I want to modify to use select boxes instead of divs, but I have a little problem with what I have. Bascially, the user selects an option and it changes the text in between the ' ' (VALUE) to whatever the value of the option is: Code: <select onchange="updateLangTo('VALUE')"> <option value="en">English</option> <option value="ar">Arabic</option> </select> So how would JavaScript be able to accomplish this? i have this simple js example to click Delete Post and then give the user two options. If they click yes then they go that page...but how do i set it to where when they click cancel it goes back to "Delete Post" ??? i suck at javascript Code: <html> <body> <p><b>Delete Post</b></p> <script type="text/javascript"> window.onclick=function(){ document.getElementsByTagName("p")[0].innerHTML="<b><a href='#'>Delete</a> || Cancel</b>" } </script> </body> </html> 1. I want to make form with 2 select filds that one of them will be disabled if in the first the use choose a specific option i wrote it in this way (but its not work) how I fix it? Code: <script type="text/javascript"> function itay() { if (document.some1.one.value="x") document.some1.two.disabled=true if (document.some1.one.value="y") document.some1.two.disabled=false } </script> </head> <body bgcolor="#FFFFFF"> <form name="some1"> <table> <tr> <td> <select id="one" onclick="itay()"> <option value="x">x</option> <option value="y">y</option> </select> </td> <td> <select id="two"> <option value="a">a</option> <option value="b">b</option> </select> </td> </tr> </table> </form> 2. I want that after u fill the form and press submit u will see a txtarea with all the options u selected (for confirm that you chose the right things) and then press submit agien and get all the things u saw in the txtarea to a Email. (Hope u understand ) so how I do it? |