JavaScript - Time Picker In Input Text Box
Hi,
I'm trying to display a time clock in input text box. The time should display in Time utilization box after clicking on START BUTTON. I tried the below code and it is not starting the time. However, I tried the javascript individually and it worked. Any help? PHP Code: <script type="text/javascript"> var seconds = 0; var minutes = 0; var hours = 0; function zeroPad(time) { var numZeropad = time + ''; while(numZeropad.length < 2) { numZeropad = "0" + numZeropad; } return numZeropad; } function countSecs() { seconds++; if (seconds > 59) { minutes++; seconds = 0; } if (minutes > 59) { hours++ minutes = 0; } document.getElementById("time_utilization").innerHTML = zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds); } function startTimer() { action = window.setInterval(countSecs,1000); } </script> </head> <body> <?php include("header.php"); ?> <div class="art-content-layout"> <div class="art-content-layout-row"> <div class="art-layout-cell art-content"> <div class="art-post"> <div class="art-post-body"> <div class="art-post-inner art-article"> <form name="tracker" method="post" action="processor.php" onsubmit="return formCheck(this);"> <ul> <li class="mainForm" id="fieldBox_8"> <label class="formFieldQuestion">Start Time *</label><input readonly class=mainForm type=text name=start_time id=start_time size='30' value=''> <input type="button" id="start1_time" style="width: 100px" Value="Start Time" onClick="startTimer()"></li> <li class="mainForm" id="fieldBox_12"> <label class="formFieldQuestion">Time Utilization</label><input class=mainForm type=text name="time_utilization" id="time_utilization" size='8' value='00:00:00' ></li> <br /> <br /> <li class="mainForm"> <input id="saveForm" class="mainForm" type="submit" value="Submit" style="width : 100px"/> </li> </form> I am getting "Unknown Runtime Error at line 43". However, code has below line at link 43: Code: document.getElementById("time_utilization").innerHTML = zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds); Similar Tutorialsdoes anyone know of a timepicker that i can disable weekends and bank holidays (or that at least easily has a place i can add code to disable days by making a call to my database of holidays in ajax?) Hi all can someone guide me (total JS newbie) on this presumably pretty easy task? I have a "parent" page with some text inputs in it (a form). This is what I am after: -when the user clicks a link it pops open a new window via JS - "child" (this is working). -in the "child" window there are also some text inputs (another form) (done). -when the user changes the value for 'testChild_textInput_4' in the child window, then I want it to automatically set this same value, to effectively overwrite, what is currently in 'testParent_textInput_2' in the parent window. Presumably this involves an onChange event, but it is also OK with me if the needful (the text input's value in the parent window being overwritten) happens upon the child window's form submit. If anyone can show me either trick, I would be thrilled! I set up a test page to make this all easy to talk about: http://www.yellow-turtle.com/testDumpMe_parent.html Please let me know! Thanks! -John I am thinking this should be fairly easy but yet I am not getting far. I want to have a form with a single text imput field for a zip code. Depending on which zip code the user enters will determine which url they will be sent to. If they enter a zip code which is not in the script, they would be sent to a default url. I am also assuming this can be accomplished with javascript. Any help is greatly appreciated. Hi, I am a beginner to javascript , I wish to learn how to create a .txt in local machine and store the data input in the textarea with the current data & time updated too. I am wondering is it possible to do so ? Please provide me a website or tutorial that I can learn about this. I tried to search it over the net but I just can't find a suitable tutorial for beginners like me. Thanks for the help. I appreaciate a lot. If I have post this thread in a wrong section, please kindly move it to a correct section as I can't find the suitable section to ask about this. I'm looking for a good javascript time & date popup other than this one. It conflicts with Joomlas javascript code and causes problems in the back-end. Other than that, it's perfect. Does anyone know of any other free calendar popups that let you pick both date and time? Hi, I'm new to javascripts. I have a perl script that takes 2 sets of dates as input: http://myhost/perlscript.pl/?startda...ate=yyyy-mm-dd I would like to have a date picker for the 2 arguments and pass them as yyyy-mm-dd format . thanks, Sirjune well title says it all i have a search form, and the default value is "enter text here" when the user click the submit button, i would like to check if the value of my text input is "enter text here" and if it is, then don't submit the form (popup a warning or something) how can i do that? thanks a lot! Good day! I explore something so I used jquery in my date, without any knowledge about jquery. I research a sample Jquery Date Picker internet and I found one, my problem is the Year is started at 2001 , I don't know if I could change it so that the year would start atleast 1950's or 1990's here's the code that I add in my webpage to display the Jquery Date Picker Code: <link rel="stylesheet" href="ui.all.css" type="text/css" media="screen" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#date").datepicker({ showOn: 'button', buttonText: "Select your Birthday" }); }); </script> I will attach the date picker that I get from internet. Thank you I have an issue with a javascript date picker. I need to figure out how to get the date to submit from the date picker into my database. Haven't been able to get any help from the maker of the date picker. I have a form which is collecting about 15 other items and I need the date to go in as well. Any help would be great.
Hi to aLL CAN ANY BODY HELP ME OUT IN WRITING JAVASCRIPT CODE FOR MONTH PICKER HERE I DONT NEED DATE, I JUST WANT ALL THE MONTHS IN PLACE OF DATES AND AN OPTION FOR SELECTING YEARS, WHEN I SELECT MONTH AND CHOOSE YEAR, THEN TEXT FIELD GET JAN-2008 clearly, need a calender with out date in it, months and years.... colud you please give me any information regarding this thank you I have been working on this picker calendar all day and I am completely stumped. The calendar will show. Any help with this code would be REALLY appreciated!! Thank you!! <!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"> <head> <title>Central Valley Snowboarding</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="js_styles.css" type="text/css" /> </head> <body> <h1>Central Valley Snowboarding</h1> <h2>Group Reservations</h2><hr /> <form action="FormProcessor.html" method="get" enctype="application/x-www-form-urlencoded"> <h3>Snowboarding Date</h3> <p><input type="text" name="reservationDate" /> <a href="" onclick="displayCalendar()">Select Date</a></p> <h3>Group Leader</h3> <table border="0"> <tr valign="top"> <td>Last name<br /> <input type="text" name="leaderLastName" size="50" /> <br /> First name<br /> <input type="text" name="leaderFirstName" size="50" /> <br /> Telephone<br /> <input type="text" name="leaderTelephone" size="50" /> <br /> Address<br /> <input type="text" name="leaderAddress" size="50" /><br /> City, State, Zip<br /> <input type="text" name="leaderCity" size="34" /> <input type="text" name="leaderState" size="2" maxlength="2" /> <input type="text" name="leaderZip" size="5" maxlength="5" /></td> </tr></table> <script type="text/javascript"> /* <![CDATA[ */ var dateObject = new Date(); var month = dateObject.getMonth(); var monthArray = new Array("January","February","March","April","May","June", "July","August","September","October","November","December"); var dateToday = monthArray[month] + " " + dateObject.getDate() + ", " + dateObject.getFullYear(); document.forms[0].reservationDate.value = dateToday; function displayCalendar(whichMonth) { calendarWin = window.open("", "CalWindow", "status=no,resizable=yes,width=400,height=320,left=200, top=200"); calendarWin.focus(); calendarWin.document.write("<!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'> <head><title>Central Valley Snowboarding</title><meta http-equiv='content-type' content='text/html; charset=iso-8859-1' /> <link rel='stylesheet' href='js_styles.css' type='text/ css' /></head><body>"); calendarWin.document.write("<table cellspacing='0' border='1' width='100%'>"); } if (whichMonth == -1) dateObject.setMonth(dateObject.getMonth()-1); else if (whichMonth == 1) dateObject.setMonth(dateObject.getMonth()+1); var month = dateObject.getMonth(); calendarWin.document.write("<tr><td colspan='2'><a href='' onclick='self.opener.displayCalendar(-1);return false'> Previous</a></td><td colspan='3' align='center'><strong>" + monthArray[month] + " " + dateObject.getFullYear() + "</strong></td><td colspan='2' align='right'><a href='' onclick='self.opener.displayCalendar(1);return false'> Next</a></td></tr>"); + "</strong></td></td></tr>"); calendarWin.document.write("<tr align='center'><td>Sun</td> <td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td> <td>Sat</td></tr>"); calendarWin.document.write("<tr align='center'>"); dateObject.setDate(1); var dayOfWeek = dateObject.getDay(); for (var i=0; i<dayOfWeek; ++i) { calendarWin.document.write("<td> </td>"); } var daysWithDates = 7 - dayOfWeek; var dateCounter = 1; for(var i=0; i<daysWithDates; ++i) { var curDate = monthArray[month] + " " + dateCounter + ", " + dateObject.getFullYear(); calendarWin.document.write("<td><a href='' onclick='self.opener.document.forms[0] .reservationDate.value=\"" + curDate + "\";self.close()'>" + dateCounter + "</a></td>"); ++dateCounter; } var numDays = 0; // January, March, May, July, August, October, December if (month == 0 || month == 2 || month == 4 || month == 6 || month == 7 || month == 9 || month == 11) numDays = 31; // February else if (month == 1) numDays = 28; // April, June, September, November else if (month == 3 || month == 5 || month == 8 || month == 10) numDays = 30; for (var rowCounter = 0; rowCounter < 5; ++rowCounter) { var weekDayCounter = 0; calendarWin.document.write("<tr align='center'>"); while (weekDayCounter < 7) { var curDate = monthArray[month] + " " + dateCounter + ", " + dateObject.getFullYear(); if (dateCounter <= numDays) calendarWin.document.write("<td><a href='' onclick='self.opener.document.forms[0]. reservationDate.value=\"" + curDate + "\";self.close()'>" + dateCounter + "</a></td>"); else calendarWin.document.write("<td> </td>"); ++weekDayCounter; ++dateCounter; } calendarWin.document.write("</tr>"); } calendarWin.document.write("</table></body></html>"); calendarWin.document.close(); /* ]]> */ </script> <p><input type="submit" value="Submit Group Reservation" /></p> </form> </body> </html> Hi all , first let me just say I know incredibly little about JavaScript at all , I'm currently studying PHP however as part of a course and do occasionally use JavaScript here and there My problem is on a register page for example i have a JavaScript Date picker so users can select their D.O.B without me having to worry about if the date is valid ...etc through PHP checking. PHP Code: <tr> <th>Date of Birth :</th> <td input name="dob" id="dob"><?php $thisyear= getdate(); $myCalendar = new tc_calendar("date5", true, false); $myCalendar->setIcon("./images/iconCalendar.gif"); $myCalendar->setDate($thisyear['year'],$thisyear['month'],$thisyear['day']); $myCalendar->setPath("./"); $myCalendar->setYearInterval(1910, ($thisyear['year'])); $myCalendar->dateAllow('1910-05-13', ($thisyear['year']-18) ); $myCalendar->setDateFormat('j F Y'); //$myCalendar->setHeight(350); //$myCalendar->autoSubmit(true, "form1"); $myCalendar->writeScript(); ?></td> </tr> Now in the <head> tag of my page i do i my JavaScript validation , and was wondering what would i have to do for this to work Thus far i've tried .checked/.selected basically anything i can think of but since its not my forte there isn't a lot for me to think of PHP Code: <script type="text/javascript"> function validate(form) { if(!document.form1.agree.checked) { alert("Please check the terms and conditions"); return false; } if(!document.form1.dob.checked) { alert("Please select a date of birth"); return false; } return true; } </script> </script> Now i was wondering is there anyway to check if a valid date was selected ?? if you can offer any help it'd be much appreciated. hi folks.. how to start with color picker using a layered div? i would like to have idea about that.. if anyone have any code samples then let me know.. thank you time validation for text box valid time in 24 hours format with no seconds my textboxes have same name and id with array i am alerting the text box value onblur.It shows only the first text box value I want to alert for every text box if value is not a number Code: <?php session_start(); if (!$_SESSION['uname']) header("Location:login.php"); ?> <html><head><title>Attendance sheet</title> <link rel="stylesheet" href="att_style.css" type="text/css" > <script type="text/javascript"> function IsNumber(strAlert) { //alert(strAlert); var txtb = document.getElementById('in_time[]').value; //for (var i = 0; i < txtb.length; i++) { //var txtv = txtb[i].value; alert(txtb); //} } </script> </head> <body> <?php $cnn = mysql_connect("localhost","root",""); mysql_select_db("time_sheet",$cnn); $dbdate = mysql_query("SELECT start_mon,end_mon FROM admin"); $dd = mysql_fetch_array($dbdate); $curmon = getdate(); $nextmonth = $curmon['mon'] + 1; $start = "2012" . "-" . $curmon['mon'] ."-". $dd['start_mon']; $end = "2012" . "-". $nextmonth ."-". $dd['end_mon']; $_SESSION['fromdate'] = $start; $_SESSION['todate'] = $end; $dateMonthYearArr = array(); $fromDateTS = strtotime($start); $toDateTS = strtotime($end); for ($currentDateTS = $fromDateTS; $currentDateTS <= $toDateTS; $currentDateTS += (60 * 60 * 24)) { $currentDateStr = date("M d",$currentDateTS); $notmysql[] = $currentDateStr; $currmysql = date("Y-m-d",$currentDateTS); $mysqlfor[] = $currmysql; } echo " No of days: " . count($mysqlfor); //Table for view if (isset($_REQUEST['sub'])) { $inti = $_POST['in_time']; $outi = $_POST['out_time']; $intime = serialize($inti); $outtime = serialize($outi); $inser = unserialize($intime); $outser = unserialize($outtime); $dbdate = mysql_query("SELECT start_mon,end_mon FROM admin"); $dd = mysql_fetch_array($dbdate); $curmon = getdate(); $nextmonth = $curmon['mon'] + 1; $dateMonthYearArr = array(); $fromDateTS = strtotime($start); $toDateTS = strtotime($end); for($b = 0; $b < count($mysqlfor); $b++) { $qry = mysql_query("SELECT * FROM timetable where date = '".$mysqlfor[$b]."' "); $ds = mysql_fetch_array($qry); if(!$qry) die(mysql_error()); $check = mysql_num_rows($qry); // print_r($inser); if($check == 0) { if($inser[$b] == "") $inser[$b] = '00:00'; if($outser[$b] == "") $outser[$b] = '00:00'; $ins = mysql_query("INSERT INTO timetable VALUES ('', '".$_SESSION['uname']."', '".$mysqlfor[$b]."', '".$inser[$b]."', '".$outser[$b]."', '') "); } else { //print_r($mysqlfor[$b]); $upd = mysql_query("UPDATE `timetable` SET `in` = '".$inser[$b]."', `out` = '".$outser[$b]."' WHERE `date` = '".$mysqlfor[$b]."' "); if(!$upd) die(mysql_error()); } } } ?> <form name="myForm" method="post" action=""> <table border="1" cellspacing="0" cellpadding="2"> <tr><th scope="row">DATE</th> <?php for ($s = 0; $s < 10; $s++) { ?> <td align="center"><?php print_r($notmysql[$s]); } ?></td></tr> <tr><th scope="row">IN</th> <?php for ($ss = 0; $ss < 10; $ss++) { ///////////////getting from DB $sele = mysql_query("SELECT * FROM timetable where date = '".$mysqlfor[$ss]."' "); $emp = mysql_num_rows($sele); ?> <td align="center"> <?php $numrows = mysql_num_rows($sele); if($numrows == 0) { ?> <input name="in_time[]" id="in_time[]" type="text" onBlur="IsNumber();" size="5"> </td> <?php } else { while($row1 = mysql_fetch_array($sele)) { ?> <input name="in_time[]" id="in_time[]" type="text" onBlur="IsNumber();" value="<?php echo $row1['in']; ?>" size="5"></td> <?php } } }?> </tr> <tr><th scope="row">OUT</th> <?php for ($v = 0; $v < 10; $v++) { ?> <td align="center"> <?php $sel2 = mysql_query("SELECT * FROM timetable where date = '".$mysqlfor[$v]."'"); $numrows = mysql_num_rows($sel2); if($numrows == 0) { ?> <input name="out_time[]" id="out_time[]" type="text" size="5"></td> <?php } else { while($row2 = mysql_fetch_array($sel2)) { ?> <input name="out_time[]" id="out_time[]" type="text" onBlur="IsNumber();" value="<?php echo $row2['out']; ?>" size="5"></td> <?php } } }?> </tr> <tr><th scope="row">Late</th><?php for ($s = 0; $s < 10; $s++) { ?> <td align="center"><input name="late_time[]" id="late_time[]" onBlur="IsNumber();" type="text" size="5"></td> <?php }?> </tr> </table> <br><br> <!-- second tab--> <?php if(count($notmysql) >= 11) { ?> <table border="1" cellspacing="0" cellpadding="2"><tr><th scope="row">DATE</th> <?php for ($st = 10; $st < 20; $st++) { ?> <td align="center"><?php print_r($notmysql[$st]); ?></td> <?php } ?></tr> <tr><th scope="row">IN</th> <?php for ($g = 10; $g < 20; $g++) { $selec = mysql_query("SELECT * FROM timetable where date = '".$mysqlfor[$g]."'"); $numrows = mysql_num_rows($selec); ?> <td align="center"> <?php if($numrows == 0) { ?> <input name="in_time[]" id="in_time[]" type="text" onBlur="IsNumber();" size="5"></td> <?php } else { while($secinrow = mysql_fetch_array($selec)) { ?> <input name="in_time[]" id="in_time[]" value="<?php echo $secinrow['in']; ?>" onBlur="IsNumber();" type="text" size="5"></td> <?php } } }?></tr> <tr><th scope="row">OUT</th> <?php for ($h = 10; $h < 20; $h++) { $select = mysql_query("SELECT * FROM timetable where date = '".$mysqlfor[$h]."'"); ?> <td align="center"> <?php $numrows = mysql_num_rows($select); if($numrows == 0) {?> <input name="out_time[]" id="out_time[]" type="text" onBlur="IsNumber();" size="5"></td> <?php } else { while($secoutrow = mysql_fetch_array($select)) { ?> <input name="out_time[]" id="out_time[]" type="text" onBlur="IsNumber();" value="<?php echo $secoutrow['out']; ?>" size="5"></td> <?php } } }?></tr> <tr><th scope="row">Late</th> <?php for ($m = 10; $m < 20; $m++) { ?> <td align="center"><input name="late_time[]" id="out_time[]" onBlur="IsNumber();" type="text" size="5"></td> <?php } ?> </tr> </table> <?php } ?> <br/><br/> <!-- Third table--> <?php if(count($notmysql) >= 21) { ?> <table border="1" cellspacing="0" cellpadding="2"> <tr> <th scope="row">DATE</th> <?php for ($tt = 20; $tt < count($notmysql); $tt++) { ?> <td align="center"><?php print_r($notmysql[$tt]); ?></td><?php } ?> </tr> <tr><th scope="row">IN</th> <?php for ($j = 20; $j < count($notmysql); $j++) { $selected = mysql_query("SELECT * FROM timetable where date = '".$mysqlfor[$j]."' "); ?> <td align="center"> <?php $numrows = mysql_num_rows($selected); if($numrows == 0) {?> <input name="in_time[]" id="in_time[]" type="text" onBlur="IsNumber();" size="5"></td> <?php } else { while($treinrow = mysql_fetch_array($selected)) { ?> <input name="in_time[]" id="in_time[]" type="text" onBlur="IsNumber();" value="<?php echo $treinrow['in']; ?>" size="5"></td> <?php } } } ?> </tr> <tr><th scope="row">OUT</th> <?php for ($k = 20; $k < count($notmysql); $k++) { $selectedr = mysql_query("SELECT * FROM timetable where date = '".$mysqlfor[$k]."'"); $numrows = mysql_num_rows($selectedr); ?> <td align="center"> <?php if($numrows == 0) { ?> <input name="out_time[]" id="out_time[]" type="text" onBlur="IsNumber();" size="5"></td> <?php } else { while($treoutrow = mysql_fetch_array($selectedr)) { ?> <input name="out_time[]" id="out_time[]" onBlur="IsNumber();" value="<?php echo $treoutrow['out']; ?>" type="text" size="5"></td> <?php } } } ?> </tr> <tr><th scope="row">Late</th> <?php for ($s = 20; $s < count($notmysql); $s++) { ?> <td align="center"> <input name="late_times[]" id="late_times[]" type="text" value="<?php ?>" size="5"></td> <?php } ?> </tr> </table> <?php } ?> <!--Table End --> <a style="float:right" href="logout.php">Logout</a> <p align="center"><input name="sub" type="submit" value="Save"></p> </form> </body> </html> hi all, im looking for a script that does the following when the page loads "text1" is displayed. then on the next line 2 seconds later "text2" is displayed and test1 is still displayed. and i need this to go to 5 lines so the final project should look like --- text1 text2 text3 text4 text5 thanks I would appreciate if anyone could guide my point by point on how one could create a category picker just like gumtree (preferably in jquery): http://www.gumtree.com/add_posting.html?location_id=uk Specifically the points How clicking on a category opens another to the right How clicking on a category appends a variable like "#cat-10201" into the url (and vice versa) How css lists are used instead of form select menus (making it easily styled) How clicking on a deep subcategory automatically preselects all parent categories I'm not looking for anyone to actually code it for me (that would be outrageous ) but tips on how it's actually structured and steps on how it can be coded would be highly appreciated. I can do PHP and I know CSS also. I don't know plain javascript but I'm sure I can do most of it in jQuery Hi All, i am having some difficulties to figure out how can i link get my calendar (datepicker) working with my dynamic generated textbox . I am using a Jquery file that i download form the net <!-- link calendar files --> <script language="JavaScript" src="calendar_us.js"></script> <link rel="stylesheet" href="calendar.css"> and here is my code to generate my dynamic controls which is working fine actually..i need to have : 1- option : the datepicker showing up once i click on StartDate textbox 2- in the future i ll use an img and i want to use it to populate the datepicker. below is my modest javascipt code i use to create dynamic textbox: <script type="text/javascript"> // Declare element id for different dynamic generated controls var elementid = 1; function addNew() { var elementrow = 1; // Get the main Div in which all the other divs will be added var mainContainer = document.getElementById('mainContainer'); // Create a new div for holding text and button input elements var newDiv = document.createElement('div'); var bgc ="##E2E2E2"; //"##b2d47e"; newStartDate = document.createElement( 'INPUT' ); newStartDate.id = 'id' + elementid + elementrow; newStartDate.setAttribute('id1','id'+ elementid+elementrow); newStartDate.setAttribute('name','StartDateName'+ elementid+elementrow); newStartDate.size=8; newStartDate.style.backgroundColor= bgc; // Create buttons for creating and removing inputs var newAddButton = document.createElement('input'); newAddButton.type = "button"; newAddButton.value = " + "; newAddButton.title = " Add new Project"; var newDelButton = document.createElement('input'); newDelButton.type = "button"; newDelButton.value = " - "; newDelButton.title = " Remove Project"; // Append new text input to the newDiv newDiv.appendChild(newStartDate); // Append new button inputs to the newDiv newDiv.appendChild(newAddButton); newDiv.appendChild(newDelButton); // Append newDiv input to the mainContainer div mainContainer.appendChild(newDiv); // Add a handler to button for deleting the newDiv from the mainContainer newAddButton.onclick = addNew; newDelButton.onclick = function() {mainContainer.removeChild(newDiv);}; elementid++; } </script> any help will be apprecited ! thanks dear all.... could you help me how to created database popup picker with javascript and php....i use mysql databse. best regards I am the webmaster for the amateur radio club I am a member of. One of the pages on our newly redesigned website is a swap shop, where people can list items for sale. To keep the page from becoming too bloated and cumbersome, I stated in the header that ads would only be listed for 30 days. I found a javascript on JavaScriptKit.com that has the features I am looking for, in that it makes something disappear after a set period of time. I need help modifying it now to make a <div> disappear from the website, instead of just an image. Here is the code, with all credits shown: Code: <script> <!-- /* "Whats new?" image script- By JavaScript Kit (www.javascriptkit.com) Over 200+ free scripts here! */ //set the below to the image you wish to use as the "new" image var imagetag='<img src="../../news.gif">' var today=new Date() function expireat(expiredate){ var expire=new Date(expiredate) if (today.getTime()<=expire.getTime()) document.write(imagetag) } //--> </script> Anyone have an idea where to go after I remove the var imagetag? I know this requires setting the <div> element's visibility to "hidden" after the period of time set by the javascript. I just am not sure how to go about doing it. My website is engineered to be simple, no CMS in place. This is in the event that someone who has little to no HTML coding experience has to take over my webmaster duties in the future. Hi Guys, I am looking for a script to change text on a page based on the time of day. From 9am - 5pm weekdays I would like the page to display 'Open', and outside of that window to display 'Closed'. I am using HTML & PHP. Any help would be greatly appreciated. Thanks, Matt |