JavaScript - Please Help! Character Counter Working Incorrectly For Reason
Hi all. Can someone please help me make this code accurate so it counts the correct number of characters? when u click on the box, it should display 0. when u type in the box, it should count up by 1. when u click on the box, and u delete a character or characters, it subtracts that many
code: Code: <form method="POST"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100%"> <textarea onkeyDown="count_it(this)" rows="12" name="charcount" cols="60" wrap="virtual"></textarea> </td> </tr> <tr> <td width="100%"><div align="right"><p> <input type="text" name="displaycount" size="20"></p> </div></td> </tr> </table> </form> <script language="JavaScript"> function count_it(what){ formcontent=what.form.charcount.value what.form.displaycount.value=formcontent.length } </script> Similar TutorialsH, I'm trying to create an sms form. but I want the users to be able to monitor the characters and sms number as they type...taking 160 characters to be 1 page. pls I'll need help with coding this form to display characters left in 'ch_count' box and number of pages in the 'pages' box while typing in the 'message' textarea....hope it's clear enough...thanks Code: <p> <textarea name="message" cols="" rows="" id="message"></textarea> </p> <p> <input name="ch_count" type="text" id="ch_count" size="8" /> characters left <input name="pages" type="text" id="pages" size="8" /> pages </p> Hi there, i have this simple script that replaces the scrollbar of an iframe called iFrame1 with 2 up and down arrow images, but it only works in IE, i've tried it in Chrome and Firefox... here is the code Code: <script type="text/javascript" language="javascript"> function bsh_iFrame1(step,time){hs_iFrame1=setInterval("sh_iFrame1("+step+")",time)} function esh_iFrame1(){clearInterval(hs_iFrame1)} function sh_iFrame1(step) { scrollx=iFrame1.document.body.scrollLeft scrolly=iFrame1.document.body.scrollTop scrolly=scrolly+step iFrame1.window.scroll(scrollx,scrolly) } </script> Code: </td><td align="center" valign="middle" width="31"><img src="up.png" alt="up" border=0 vspace="5" hspace="3" onMouseDown="esh_iFrame1();bsh_iFrame1(-3,2)" onMouseUp="esh_iFrame1();bsh_iFrame1(-1,20)" onMouseOver="bsh_iFrame1(-1,20)" onMouseOut="esh_iFrame1()"><br> <img src="down.png" alt="down" border=0 vspace="5" hspace="3" onMouseDown="esh_iFrame1();bsh_iFrame1(3,2)" onMouseUp="esh_iFrame1();bsh_iFrame1(1,20)" onMouseOver="bsh_iFrame1(1,20)" onMouseOut="esh_iFrame1()"> thanks in advance for any answers... hi all. im having problems with this ajax script i wrote: Code: function admin_adduser() { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } user = document.getElementById('user_user').value; user = user.replace(/^\s+|\s+$/g, '');// trim whitespace //check if name is unique unique = 'false'; var params = "?user=" + escape(user); var url="_check_username.php"; url=url+params; ajaxedInner = ""; xmlHttp.open("GET",url,true); xmlHttp.setRequestHeader("If-Modified-Since", "Fri, 31 Dec 1999 23:59:59 GMT"); xmlHttp.onreadystatechange=stateChanged; xmlHttp.send(null); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { unique = xmlHttp.responseText.replace(/^\s+|\s+$/g, ''); //trims all whitespace! //alert(unique); } } } if(unique == 'true') { //alert("working: " + unique); password = document.getElementById('user_password').value; var params = "?user_user=" + escape(user) + "&user_password=" + escape(password); var url="_admin_add_user.php"; url=url+params; ajaxedInner = "users"; xmlHttp.open("GET",url,true); xmlHttp.setRequestHeader("If-Modified-Since", "Fri, 31 Dec 1999 23:59:59 GMT"); xmlHttp.onreadystatechange=stateChanged; xmlHttp.send(null); document.getElementById('user_password').value = ""; document.getElementById('user_user').value = ""; } else { alert('Please select a unique name for the new staff member\nadd a middle initial maybe?'); } } if i alert(unique) it tells me 'true' (string) but still doesnt go into the create part of the script, i just get the alert('Please select a unique name for the new staff member\nadd a middle initial maybe?'); any ideas? i know im probably missing something basic but its really annoying lol btw - the php for the _check_username.php is simple: PHP Code: <?php if(!isset($_SESSION)) {session_start();} if($_SESSION['authorised'] != true) { exit; } include 'config.php'; include 'opendb.php'; $user = $_REQUEST['user']; $query = "SELECT user FROM user WHERE user='$user'"; echo $query; $result = mysql_query($query) or die('false'); $row = mysql_fetch_array($result, MYSQL_ASSOC); if($row) { echo 'false'; } else { echo 'true'; } mysql_free_result($result); ?> I am trying to fix some datetime strings so I can convert form values into date objects so I can compare the dates in my validation process. the date time strings look like - 7/21/2011 8:00am for some reason the am is not being replaced by " am" . here's the function Code: function ampm(str){ str.replace(/am/gi," am") str.replace(/pm/gi," pm") return str } for example the result of ampm("8:00am") is 8:00am and not 8:00 am .. it seems so simple. I am attempting to create a web based quote system that pops up a preview of the fencing type selected on click. but nothing works.. im frustrated with this and need a bit of guidance. hopefully someone will help here is the HTML body of the form Code: <body> <form action="" id="fenceprice" onsubmit="return false;"> <fieldset> <legend>Let's get a quote together for you!</legend> <p>How many feet of fencing do you need? <input type="number" name="length" min="1"></p> <label >Type of fence (Price/foot)</label><br> <input type="radio" name="fence" value="StockadePrivacy" onclick="calculateTotal()" /> Stockade Privacy Fence ($13.99)<br> <input type="radio" name="fence" value="OverlappingPrivacy" onclick="calculateTotal()" /> Overlapping Privacy Fence ($14.99)<br> <input type="radio" name="fence" value="ShaddowboxPrivacy" onclick="calculateTotal()" /> Shaddowbox Privacy Fence ($15.99)<br> <input type="radio" name="fence" value="3BoardHorse" onclick="calculateTotal()" /> 3 Board Horse Fence ($5.99)<br> <input type="radio" name="fence" value="4BoardHorse" onclick="calculateTotal()" /> 4 Board Horse Fence ($6.99)<br> <input type="radio" name="fence" value="4FtChain" onclick="calculateTotal()" /> 4 foot Chain Link Fence ($6.50)<br> <input type="radio" name="fence" value="6FtChain" onclick="calculateTotal()" /> 6 foot Chain Link Fence ($7.99)<br> <input type="radio" name="fence" value="4FtField" onclick="calculateTotal()" /> 4 foot Field Fence ($5.25)<br> <input type="radio" name="fence" value="6FtField" onclick="calculateTotal()" /> 6 foot Field Fence ($7.25)<br> <input type="radio" name="fence" value="4FtNoClimb" onclick="calculateTotal()" /> 4 foot Field Fence with No Climb Wire ($5.73)<br> <input type="radio" name="fence" value="4FtCross" onclick="calculateTotal()" /> 4 foot Cross Fence ($6.75)<br> <input type="radio" name="fence" value="4FtCrossWire" onclick="calculateTotal()" /> 4 foot Cross Fence with No Climb Wire ($7.25)<br> <input type="radio" name="fence" value="BarbedWire" onclick="calculateTotal()" /> 4 Strand Barbed Wire Fence ($5.00)<br> <input type="radio" name="fence" value="4FtVinyl" onclick="calculateTotal()" /> 4 foot Vinyl Fence ($15.99)<br> <input type="radio" name="fence" value="6FtVinyl" onclick="calculateTotal()" /> 6 foot Vinyl Fence ($17.99)<br> <p> <label for='includepaint' class="inlinelabel"> Include Paint($1.25/foot)</label> <input type="checkbox" id="includepaint" name='includepaint' onclick="calculateTotal()" /> </p> <p> <input type= "submit" name="submit" onclick="calculateTotal()" /> </p> <div id="totalPrice"></div> </fieldset> </form> </body> here is my js for the preview images (js.js) Code: var app = preview.module('app' , ['ui.filters']); function MainController($scope) { function Preview(type, imageSrc){ this.type = type; this.imageSrc = imageSrc; }; var fenceType = [ new Fence("StockadePrivacy" , "nicks work/single gate stockade.jpg"), new Fence("OverlappingPrivacy" , "nicks work/board over board privacy fence (3).jpg"), new Fence("ShaddowboxPrivacy" , "nicks work/shadowbox (2).jpg"), new Fence("3BoardHorse" , ""), new Fence("4BoardHorse" , "nicks work/titan (37).jpg"), new Fence("4FtChain" , ""), new Fence("6FtChain" , "nicks work/1003154_498266626917855_1385007596_n.jpg"), new Fence("4FtField" , "nicks work/wire by road.jpg"), new Fence("6FtField" , "nicks work/field wire.jpg"), new Fence("4FtNoClimb" , ""), new Fence("4FtCross" , "nicks work/cross fence black.jpg"), new Fence("4FtCrossWire" , ""), new Fence("BarbedWire" , ""), new Fence("4FtVinyl" , "nicks work/4ft vinyl.jpg"), new Fence("6FtVinyl" , "nicks work/6ft vinyl.jpg") ]; $scope.fenceType = fenceType; $scope.getCurrentFenceImage = getCurrentFenceImage; function getCurrentFence() { return_.find($scope.fenceType, { type: $scope.fenceType}) || {}; } function getCurrentFenceImage() { return getCurrentFence().imageSrc; }; } here is my code for the form calculations (formcalculations) Code: var fence_price = new Array(); fence_prices["StockadePrivacy"]=13.99; fence_prices["OverlappingPrivacy"]=14.99; fence_prices["ShaddowboxPrivacy"]=15.99; fence_prices["3BoardHorse"]=5.99; fence_prices["4BoardHorse"]=6.99; fence_prices["4FtChain"]=6.5; fence_prices["6FtChain"]=7.99; fence_prices["4FtField"]=5.25; fence_prices["6FtField"]=7.25; fence_prices["4FtNoClimb"]=5.73; fence_prices["4FtCross"]=6.75; fence_prices["4FtCrossWire"]=7.25; fence_prices["BarbedWire"]=5; fence_prices["4FtVinyl"]=15.99; fence_prices["6FtVinyl"]=17.99; function getQuantity() { //Assume form with id="theform" var theForm = document.forms["fenceprice"]; //Get a reference to the TextBox var length = theForm.elements["length"]; var howmuch =0; //If the textbox is not blank if(quantity.value!="") { howmuch = parseInt(quantity.value); } return howmuch; } function paintPrice() { var paintPrice=0; //Get a reference to the form id="fenceform" var theForm = document.forms["fenceprice"]; //Get a reference to the checkbox id="includecandles" var includePaint = theForm.elements["includepaint"]; //If they checked the box set candlePrice to 5 if(includePaint.checked==true) { paintPrice=1.25; } //finally we return the candlePrice return paintPrice; } function getFenceSizePrice() { var fenceSizePrice=0; //Get a reference to the form id="fenceform" var theForm = document.forms["fenceform"]; //Get a reference to the fence the user Chooses name=selectedCake": var selectedFence = theForm.elements["selectedfence"]; //Here since there are 4 radio buttons selectedCake.length = 4 //We loop through each radio buttons for(var i = 0; i < selectedFence.length; i++) { //if the radio button is checked if(selectedFence[i].checked) { fenceSizePrice = fence_prices[selectedFence[i].value]; break; } } //We return the fenceSizePrice return fenceSizePrice; } function getTotal() { //Here we get the total price by calling our function //Each function returns a number so by calling them we add the values they return together var fencePrice = getFenceSizePrice() * getQuantity() + paintPrice() * getQuantity(); //display the result var divobj = document.getElementById('totalPrice'); divobj.style.display='block'; divobj.innerHTML = "Total Price For Fencing $"+fencePrice; } function hideTotal() { var divobj = document.getElementById('totalPrice'); divobj.style.display='none'; } Reply With Quote 12-19-2014, 01:01 AM #2 Old Pedant View Profile View Forum Posts Supreme Master coder! Join Date Feb 2009 Posts 28,311 Thanks 82 Thanked 4,754 Times in 4,716 Posts So have you used your error console? Or your JavaScript debugger? Hit the F12 key to bring up both. I recommend using the Chrome browser for this because I like its integration of the console and debugger, et. al., best. But any modern browser will do. Are you getting errors right off the bat from the error console? Are you getting errors when you try to select a fence, etc.? Tell us *WHAT* is going wrong. Don't make us re-construct your page so we can use our error console. And if you still can't figure it out, can you post the page LIVE someplace? Give us a URL to look at? This code snippet below was extracted from a rather large javascript. It is not written here to function alone, but it is solely to illustrate my question, Why can't a variable be read from within a function when it has been set as the text of a url address, in this case www.google.com)? When I click on the browser HREF that calls the OnClick event, the function SwitchFN, I receive the following 2 alerts: "Ones" (variable is output as expected) "undefined" (the second variable is no longer defined within the function, however using the command alert(numtwo) in the variable definition section of my code will work as expected and the alert will be "www.google.com" Why can't the function see the variable when it is a URL? Code: I have set several default variables up in the beginning of my script: var numone = "Ones" var numtwo = "www.google.com" /// more variables set /// more functions function switchfn(nfn,nrm) { document.cookie = "mvrfile=" + numone alert(numone) alert(numtwo) } document.write('<TR><TD BGCOLOR=# ALIGN=LEFT VALIGN=top WIDTH=60 COLSPAN=2><A HREF="#" onClick="switchfn(\'' + myview + '\',\'' + mytxt + '\')">' + mytxt + '</A></TD></TR>') ; I have the following function: Code: function sonKare(sayac, oteki) { var vertical, horizontal = hangiYataySira(sayac, oteki), j, k, l, m, united, tekRakam, actualV = [], actualH = [], numaralar = [1, 2, 3, 4, 5, 6, 7, 8, 9], olmayanlar = []; if(ilkSefer === true) { vertical = hangiDikeySira(rakamlar.length); ilkSefer = false; } else { vertical = hangiDikeySira(rakamlar.length - 1); } for(j = 0; j <= vertical.length - 1; j ++ ) { if(rakamlar[vertical[j]] !== undefined) actualV.push(rakamlar[vertical[j]]); } for(k = 0; k <= horizontal.length - 1; k ++ ) { if(rakamlar[horizontal[k]] !== undefined) actualH.push(rakamlar[horizontal[k]]); } united = actualV.concat(actualH); //---- Olmayan rakamları bulan kısım ------------ outer: for(l = 0; l <= numaralar.length - 1; l++) { for(m = 0; m <= united.length - 1; m++) { if(numaralar[l] === united[m]) continue outer; if(m === united.length - 1 && numaralar[l] !== united[m]) olmayanlar.push(numaralar[l]); } } //---------------------------------------------- if(olmayanlar.length > 1 || olmayanlar.length === 0) { rakamlar = []; document.form1.buton.click(); // THIS LINE DOES NOT WORK SECOND TIME } else { $("_" + oteki + "_" + sayac).value = olmayanlar[0]; rakamlar.push(olmayanlar[0]); sayac++; if(sayac === 10) return; else sonKare(sayac, oteki); //CALLS ITSELF } } This is a recursive function. As stated above there is a line which does not work for the second time. What I mean is, it works perfect for the first time and after function calls itself, it doesn't work. Javascript does execute the line above it but just disregards that document.form1.buton.click(); line. I use Firebug for debugging and I checked it many times, when that expression needs to be executed for the second time, JavaScript just ignores it and immediately goes at the end of the function... I just can't figure out why JS does such a thing? p.s: Don't bother about weird variable names, they are not in English but in Turkish which is my native language Hi, I'm making a Google Map that reads info from a database and pulls Twitter usernames from it to plot points on a map. In the infowindow of these points I have some code that displays the Twitter users latest tweet. There's alot of code for this map so i'll only show you the part i'm working on: Code: function readData() { var request = GXmlHttp.create(); request.open("GET", "phpsqlinfo_result.php", true); request.onreadystatechange = function() { if (request.readyState == 4) { var xmlDoc = GXml.parse(request.responseText); // obtain the array of markers and loop through it i=[0]; markers=[0]; map.getInfoWindow().hide(); gmarkers = []; map.clearOverlays(); side_bar_html = ""; var markers = xmlDoc.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { // obtain the attribues of each marker var lat = parseFloat(markers[i].getAttribute("lat")); var lng = parseFloat(markers[i].getAttribute("lng")); var point = new GLatLng(lat,lng); var label = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address"); var type = markers[i].getAttribute("type"); var html = '<' + 'script src="http://twitter.com/javascripts/blogger.js"><' + '/script><' + 'script type="text/javascript" src="http://twitter.com/statuses/user_timeline/' + label + '.json?callback=twitterCallback2&count=1"><' + '/script><br /><div id="twitter_update_list" style="list-style:none"></div>'; // create the marker var marker = createMarker(point,label,html); map.addOverlay(marker); } // put the assembled side_bar_html contents into the side_bar div document.getElementById("side_bar").innerHTML = side_bar_html; } } request.send(null); } var html is where it's all happening. I'm using the Twitter script from http://limetouch.com/article/valid-x...vascript-code/ and I have it laid out with all them ' + ' to break it up so it doesn't end the actual javascript used to create the map. I'm new to Javascript so I don't know too much. I know that this method is a really backwards way of doing it, but it works for Firefox. I'm able to retrieve the users latest tweet when I click on their map marker. What I want to know is why it doesn't work in any other browser? I've tried IE7+8, Google Chrome, Opera, and Safari and no tweet displays. Sub-question: While a tweet does display in Firefox, the infowindow doesn't resize with the dynamic content. Any way to fix that? I am working with using Javascript to create a page that scales and keeps its aspect ratio (much like a Flash page would). After a lot of trial and error, I have a prototype up with a couple of problems. It loads correctly once in I.E. Reloading, or opening a new browser, will also load the page correctly. But visiting a different page and coming back causes the width attributes to break. This happens with the non-aspect-ratio version in pure HTML also, but I was hoping that this problem would be solved by establishing values based on javascript variables. As for Firefox, the problem is more or less exactly the opposite. The page loads up all wonky the first time, and a reload or resize will fix it for every time afterward. To see what I'm talking about, you can take a look at http://www.jonesmfgmusic.com/testpag...lem_width.html For the HTML only version, see http://www.jonesmfgmusic.com/testpag...blem_html.html I'm guessing this is something to do with the order in which the data is loaded, so that once the information is all cached, it stops functioning in IE, and starts functioning in FF... can anyone confirm whether I'm on the right track with that, or how to fix it if I am? I'm most concerned by the fact that the width attribute is behaving as it does in IE. That looks like some kind of Microsoft bug to me, and I need a way around it. As for Firefox, I am guessing if I can just get it to load all of the correct information ahead of time, the page should come up correctly, but I just can't think how to do that. I started on the following page (part of an asp.net solution), but the damned thing keeps reloading. Anyone able to spot the problem? Cheers! Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title> Untitled Page </title></head> <body> <form name="form1" method="post" action="jstest3.aspx" id="form1"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMjYxNzg2NjFkZMc95XPGgLBVJLhpE9SpA+WIaf+s" /> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwKUmIGgCgLs0bLrBgKM54rGBm+z7+T68pYhg8H9O6b/Ex0HpZ0A" /> </div> <div> <input name="TextBox1" type="text" id="TextBox1" /> <input type="submit" name="Button1" value="Button" id="Button1" /> <script language="javascript" type="text/javascript"> if (parent != null) { tb = parent.document.getElementById("TextBox"); tbLocal = document.getElementById('TextBox1'); if (tb != null) tbLocal.value = tb.value; btn = document.getElementById('Button1'); if (btn != null) btn.click(); } </script> </div> </form> </body> </html> Hi, I need your help with a javascript that is incorrectly displaying the time left as 12 hours instead of 24 hours. The target date is July 7, 2010 at 09:00 AM Here is the url where the script is installed: http://guaranteedtransformation.com/independence/ and here is the code: Code: <script LANGUAGE="JavaScript"> // This following statement must be left intact. // Copyright (c) Michael Bloch and Taming The Beast. // Countdown timer script v1.2 April 20 2009 // Taming the Beast.net - http://www.tamingthebeast.net // Free Web Marketing and Ecommerce articles and tools // By using this code you agree to indemnify Taming the Beast // from from any liability that might arise from its use. // The preceding statement be left intact. var present; var future; var tseconds; var seconds; var minutes; var hours; var days; ID=setTimeout("countdown();", 1000); function countdown() { present = new Date(); present = present.getTime() + (60000) + (12 * 60 * 60 * 1000); future = new Date("July 07, 2010 09:00:00"); tseconds = (future - present) / 1000; days = tseconds /24/60/60; days = Math.floor(days); tseconds = tseconds - (days * 24 * 60 * 60); hours = tseconds /60/60; hours = Math.floor(hours); tseconds = tseconds - (hours * 60 * 60); minutes = tseconds /60; minutes = Math.floor(minutes); tseconds = tseconds - (minutes * 60); seconds = tseconds; seconds = Math.floor(seconds); document.getElementById('days').innerHTML = days; document.getElementById('hours').innerHTML = hours; document.getElementById('minutes').innerHTML = minutes; document.getElementById('seconds').innerHTML = seconds; ID=setTimeout("countdown();", 1000); } </script> And here is the html that displays the time: Code: <SPAN id="days">0</SPAN> days, <SPAN id="hours">0</SPAN> hours, <SPAN id="minutes">0</SPAN> minutes, <SPAN id="seconds">0</SPAN> seconds Thanks for your help, Jimmy Here is the link in question. I have created a small page with the isolated problem on it. http://frontendaudio.com/v/vspfiles/...pt_tester.html the javascript file that is referenced basically only does one thing. It searches for "> >" and then alerts us whether or not it's on the page. --- It pulls the innerHTML of the entire document --- the searches it - and indexes the string. I echoed the string out to a text area so you could see the string "> >" is clearly there after the word microphones in the link tag... </a> > < etc.. Any thoughts on how I can detect this string somehow? Thanks. Here is the code inside the javascript file. Code: var myStringDiscuss = 'microphones</a> >'; myStringDiscuss = myStringDiscuss.replace(/~/g,""); // unmunge function discussDetection(){ var str = document.getElementsByTagName('html')[0].innerHTML; str = str.toLowerCase(); // to make case insensitive var category_string = str.indexOf(myStringDiscuss); if (category_string == -1) { alert("not on this page"); } else { alert("IS on the page"); } } window.onload= discussDetection; Hey Everyone, I'm working on a counter. I have two images - each with their own click count. Right now each time the page loads the counter goes back to zero. I would assume I need some kind of server side coding. Any recommendations? Here's what I have so far. <html> <head> <script type="text/javascript"> var counter = 0; function increaseloveit() { counter += 1; document.getElementById('loveit').value = counter; } var counter = 0; function increasehateit() { counter += 1; document.getElementById('hateit').value = counter; } </script> </head> <body> <form> <a href="#" onclick="javascript:increaseloveit();"><input type="button" value="Love It!" name="loveit" onclick="" /></a><input id="loveit" value="0" size="2" /></form> <form> <a href="#" onclick="javascript:increasehateit();"><input type="button" value="Hate It!" name="hateit" onclick="" /></a><input id="hateit" value="0" size="2" /></form> </body> </html> So I'm really new to javascript and html. The most advanced thing Ive made was probably a Russian rullete simulator, but I need help with this one program Im working on. So if anyone could tell me whats wrong with this, I would appreciate it! <html> <head> <font size="4">Click the button below as many times as you can</font> <br> <script type="text/javascript"> var clicks=0 function count() { clicks=clicks+1; } </script> </head> <body> <input type="button" value="Click Me" OnClick="count()"> <br> <p>Clicks: <script type="text/javascript"> document.write(clicks); </script></p> </body> </html> I have the following codes and it seems to work well but when exiting the site and re-entering it resets the values to 0 again. I am not sure how to proceed with this, been considering cookies but what if the user clears there cookies, I then looked at PHP but not understanding that to well at this stage. Javascript Code: // Function to count clicks on links var clicks1 = 0; var clicks2 = 0; var clicks3 = 0; var clicks4 = 0; function link1(){ document.getElementById('clicked1').value = ++clicks1; } function link2(){ document.getElementById('clicked2').value = ++clicks2; } function link3(){ document.getElementById('clicked3').value = ++clicks3; } function link4(){ document.getElementById('clicked4').value = ++clicks4; } HTML Code: Code: <tr valign="middle" align="center"><td colspan="1"><a target="_blank" href="http://mistiquestormelectronics.webs.com/" onclick="link1()"><img src="site_graphics/reinet.jpg" alt="Mistique Storm" width="120" height="90" /></a></td> <td colspan="2" align="left"><p>For all your Electronic equipment needs.</p></td> <td colspan="1" width="8%"><input id="clicked1" style="color: #000000; font-weight:bold; border-style: none; font-family: arial; background-color: #00FF00; text-align: center;" readonly="readonly" size="10" onfocus="this.blur();" value="0" ></td></tr> Any ideas, suggestions. Please Help? I need help with a counter that will either display a different image everyweek or change text every week. The scenario is a counter will be on the top right corner of the page, and every week the number will change from 1 to 2 to 3... to 52... I searched on this forum for answers, i found some similar for a different day counter. Any help would be great! Hi All, could you please help me. A have a little program and i need to count somehow how many times a while loop is ran. how could i do that? Thanks for your help I am trying to use the Jquery loader (this ends when page loads) but I want it to load how many seconds the page took. (using the clean preloader) $( "#progressbar" ).progressbar({ value: setTimeout("seconds++",10000000) }); but getting "anything" to work in the "VALUE" has been such a pain. any one that knows how to create a timer to add to the value so that preload will keep loading? or if even possible? thanks |