JavaScript - Specific Menu?
Hey,
I'm working on a large demo created with html/css. It has well over a hundred pages with a left column navigation of normal links. I am trying to make this demo product specific with a page asking what product they are using before they enter the demo. Based on the users selection I want to have some of the pages be more product specific with different content and hide some pages. To create this I could just duplicate my html files to have one for each product with its respective navigation (basically resulting in two seperate demos). That however would be a nightmare for future updates. Anyone know how to script this? Any help would be awesome! Similar TutorialsAnother thing that has been driving me crazy is that css positioning is handled differently by different browsers. JS is not my area, but I can do a lot with CSS, and I do, but cross browser compatibility is killing me. I can use an IF IE statement and only IE runs that segment of code, but I haven't been able to figure out out how to make ONLY firefox or ONLY opera or safari enact an encapsulated segment of code. The same type of IF statement doesn't work for them. Is there a single method using JS that works for all browsers? Thre is probably a very simple answer and I am just missing it somehow. I am having a problem with my homework displaying an iframe using JavaScript. My homework states: Insert a script element that does the following: part a. Insert the following multiline comment: Display the daily schedule in an inline frame. Daily schedules are stored in the files sunday.html through saturday.htm. part b. Insert a command to write the HTML code <iframe src="weekday.htm'></iframe> to the Web page, where weekday is the text string returned by the weekDay() function. What I have so far: <script type= "text/javascript"> /* Display part a */ document.write("<iframe src='weekday.htm'></iframe">; </script> My Question: How do I display weekday.htm within my script on a specific day using the function weekDay() function. below is my weekDay() function: function weekDay(){ thisDate = new Date(); var thisWDay=thisDate.getDay(); var wdName = new Array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"); return wdName[thisWDay]; } I am working on a Phonegap app that sends emails that consist of form data that is filled out within the app. I need my app to send the emails which I have sorted out. The second part of the app needs to store the email subject of all the mails that are sent in local storage and then in a separate function needs to output all the saved data and send it. I will post my full code below and comment the important bits. Code: function sendMail(imageURI, click){ var d = new Date(); var dat = d.getDate(); var mon = d.getMonth(); var year = d.getFullYear(); var hours = d.getHours(); var minutes = d.getMinutes(); var seconds = d.getSeconds(); var todayDate = dat+'-'+mon+'-'+year+' | '+hours+':'+minutes+':'+seconds; var agent = $('#agent').val(); var depot = $('#selection').val(); var date = $('#free').val(); var newURI = imageURI.replace("file:///storage/emulated/0/DCIM/Camera/",""); /* -----> the variable that needs to be stored */ var newFileName = 'N' + result + '_' + agent + '_' + todayDate + '_' + newURI + '_' + depot + '_' + date; /* -----> storing the variable */ var temp = localStorage.getItem('newFileName'); var somearray=temp.split(','); somearray_length=somearray.length; somearray[somearray_length]=newFileName; var somestring=somearray.join(','); localStorage.setItem('newFileName',somestring); /* <----- storing the variable */ var largeImage = document.getElementById('largeImage'); largeImage.style.display = 'block'; largeImage.src = imageURI; cordova.plugins.email.addAlias('gmail', 'com.google.android.gm'); cordova.plugins.email.open({ app: 'gmail', to: 'blah@gmail.com', subject: newFileName, body: '<ul><li style="font-weight:bold;text-decoration: underline;"><b><u>File: </b></u></li><li>'+newURI+'</li><br><li style="font-weight:bold;text-decoration: underline;"><b><u>Agent Name: </b></u></li><li>'+agent+'</li><br><li style="font-weight:bold;text-decoration: underline;"><b><u>Next Scheduled Date: </b></u></li><li>'+date+'</li><br><li style="font-weight:bold;text-decoration: underline;"><b><u>Scanned: </b></u></li><li>'+todayDate+'</li><br><li style="text-decoration: underline;font-weight:bold;"><b><u>Depot: </b></u></li><li>'+depot+'</li></ul>', attachments: [imageURI], isHtml: true }); }; /* -----> The second function */ function endOfDay(data){ var d = new Date(); var dat = d.getDate(); var mon = d.getMonth(); var year = d.getFullYear(); var hours = d.getHours(); var minutes = d.getMinutes(); var seconds = d.getSeconds(); var todayDate = dat+'-'+mon+'-'+year+' | '+hours+':'+minutes+':'+seconds; ending=localStorage.getItem('newFileName'); var salesman = $('#agent').val(); var newsFileName = 'End of Day Report for Agent: ' + salesman + '|' + todayDate; cordova.plugins.email.addAlias('gmail', 'com.google.android.gm'); cordova.plugins.email.open({ app: 'gmail', to: 'seth.v.staden@gmail.com', subject: newsFileName, body: 'end of day report: <br>' + ending, isHtml: true }); localStorage.setItem('newFileName',''); }; my problem is that instead of outputting all the sent subjects that have been stored like so: "subject 1, subject 2, subject 3, etc..." it is outputting it as the latest mail that was sent, i.e. "subject 3, subject 3". I have no clue why this is going wrong or how to fix it... any help would be greatly appreciated. Reply With Quote 01-15-2015, 11:13 PM #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 Instead of doing all this tortu Code: var temp = localStorage.getItem('newFileName'); var somearray=temp.split(','); somearray_length=somearray.length; somearray[somearray_length]=newFileName; var somestring=somearray.join(','); localStorage.setItem('newFileName',somestring); Why not simply do Code: localStorage.setItem('newFileName', localStorage.getItem('newFileName') + "," + newFilename ); Though I admit I don't see why your code won't work. It just causes a bunch of unneeded overhead. ********** COMMENTARY: I think your dates will be unreadable by humans. var mon = d.getMonth(); That will get a ZERO for January, 1 for February, etc. For human readable, you should do var mon = d.getMonth() + 1; Hi Exprts, I am using a (anylink)javascript menu from dynamic drive. Basically I am having a design issue but posting the problem here because I think this can be fixed through JS. Please download the attached files. You will see the menu & the sub menu on mouse over. Problem is that.... when the submenu appears & I take my mouse to the sub menu, the parent item hover style disappears. I mean, it doesn't look active. I just want the parent item active when users moves his/her mouse to sub menu. Thats all. Please suggest me any solutions for this. Thank you in advance. Ok, here is the scenario... We have a commercial shopping cart software installed on our website and since it is proprietary, we do not have access to source code. But they do allow you to include custom javascript on the web pages that they generate. What I want to do is add some text after a specifc INPUT tag that appears on the page within a TD tag. The problem is, that they do not have any specifc ID assigned to the INPUT or TD tag, and although the INPUT tag has a name assigned to it, the name is used in other tags as well and is not unique. Below is the code that I used to solve the problem, but I want to know if there is a more efficient way to do it... Basically my code grabs every TD tag on the page, and then loops thru all of them looking for the specifc INPUT tag characteristics and then inserts the text afterwards (it needs to work in both Firefox and IE so you cannot use innerHTML). Thanks in advance for any suggestions! Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="generator" content="PSPad editor, www.pspad.com"> <title></title> <script type="text/javascript"> function myLoad() { var _match = false; var _tdcells = document.getElementsByTagName('td'); var _len = _tdcells.length; for (var _i=0; _i<_len; _i++) { _child = _tdcells[_i].childNodes; _child_len = _child.length; for (_j=0; _j<_child_len; _j++) { if ( (_child[_j].nodeType == 1) && (_child[_j].attributes.getNamedItem('name').value == 'zip_code') && (_child[_j].attributes.getNamedItem('onchange').value == 'zip_changed();') && (_child[_j].attributes.getNamedItem('type').value == 'text') && (_child[_j].attributes.getNamedItem('size').value == '10')) { _cell = _i + 1; alert('Found a match in cell number '+_cell); _match = true; var old_node = _child[_j]; var new_node = document.createTextNode(' New Text!'); //Insert Before usually inserts before the element, but using targetElement.nextSibling inserts it after instead!! _tdcells[_i].insertBefore(new_node, old_node.nextSibling); } } } if (_match !== true) { alert('no match found'); } } </script> </head> <body onLoad="myLoad();"> <table class="zipncountry" border="1"> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </table> <br> <table border="3"> <tr> <td>4</td> <td>5</td> <td><input type="text" name="zip_code" value="123" size=10 maxlength=20 onChange="zip_changed();"><input type="hidden" name=zip_code value="321" size=10 maxlength=20 ></td> </tr> </table> <br> <table class="zipncountry" border="5"> <tr> <td>7</td> <td>8</td> <td>9</td> </tr> </table> </body> </html> Hi I'm relatively new to Javascript and I'm trying to learn more about dates my problem is as follows I have to do validation on a form for 2 dates(StartDate and EndDate) the dates cannot be more than four months apart if they are an alert must be displayed. In other words Nov 2009 till March 2010 or May 2009 till September 2009 should be invalid regardless of the day of the month Simply 2 input boxes(StartDate and EndDate) and a submit I've got the other parts of my page worked out just this has me stumped I would appreciate any help in this regard Thank You for your time I can't seem to find what I need but I know it exists. I trying to find a vertical scroller that will automatically have the text scroll upwards but have an arrow above and arrow below to be able to control the direction of the scrolling text, or a script with no arrows but still allow me to take control by mousing over the text to scroll up or down. Thanks Hi to All, I have two menus, related each other, in this way: <head> var sum_db = new Object() sum_db["email1"] = [{value:"I01 - Problems of one level", text:"I01 - Problems of one level"}, {value:"I02 - Problems RDM", text:"I02 - Problems RDM"}, {value:"Free Text", text:"Free Text "}]; sum_db["email2"] = [{value:"I03 - Various", text:"I03 - Various"}]; // // function setIssue(chooser) { var newElem; var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var Iss_Chooser = chooser.form.elements["iss_sum"]; while (Iss_Chooser.options.length) { Iss_Chooser.remove(0); } var choice = chooser.options[chooser.selectedIndex].value; var db = sum_db[choice]; if (choice == "email1") { newElem = document.createElement("option"); newElem.text = "Choose an issue ..."; newElem.value = "Choose Issue ..."; Iss_Chooser.add(newElem, where); } for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; Iss_Chooser.add(newElem, where); if ((choice == "email1") && (db[i].text.indexOf('Free Text')==0)) { document.getElementById("label_des").style.display=""; } else { document.getElementById("label_des").style.display="none"; } } } // </script> </head> <body> <form> <select size="1" name="mess" id="mess" onchange="setIssue(this)"> <option value="email1" selected>email1</option> <option value="email2">email2</option> </select> .... .... <select id="iss_sum" name="iss_sum"> <option value="<%=objRS("Issue_Summary")%>" selected><%=objRS("Issue_Summary")%></option> </select> <label for="iss_des" id="label_des" style="display:none; vertical-align:top">Description:<textarea id="iss_des" name="iss_des"><%=objRS("Issue_Description")%></textarea> </label> My problem is: I would like that if I select ONLY email1 and ONLY the option "Free Text", appears the textarea with label Description. Up to know if one selects email1, automatically the textarea appears near for every option; it seems that the condition of the if is not respected !!! Thanks a lot in advance !!! Hello everyone, wondering if I could get some help. I have not done anything with html and javascript until this afternoon and funnily enough I'm struggling a tad I am creating a free website about the dangers of chocolate for dogs. Basically I need a calculator to calculate the toxic amount for the user input of their dogs weight in kgs. I figured doing one for each type of chocolate would be easier than doing something where a box was ticked for each type of chocolate so have been trying to do one for milk chocolate first. This is my feeble attempt, it looks good but doesnt work, my javascript is clearly majorly wrong somewhere! <html> <head> <script language="JavaScript"> function calc(form) { var f = parseFloat(form.kg.value); var T = 0; T = (f/0.45)*28.35; form.answer.value = T; } // done hiding from old browsers --> </script> </head> <body> <FORM> <h2>Toxic dose of milk chocolate</h2> Enter dogs weight in kg: <INPUT NAME="kg" VALUE="0" MAXLENGTH="100" SIZE=25> <p> Click to calculate toxic dose in grammes: <INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON onClick=kg(this.form)> <p> Toxic amount of milk chocolate is: <INPUT NAME="g" READONLY SIZE=25> </FORM> </body> </html> Can anybody help? Thanks in advance. I am looking for a specific JS which calculates the number of pets killed today in CA as well as the amount of taxpayer dollars spent - similar to the ones made for those who have quit smoking, how many cigarettes they have not smoked, how much money they have saved, etc. The starting point would be January 1, 2010 and each day it would take the number of days so far in the year times two known factors. I know the state kills 786 pets a day as well as the daily cost to taxpayers is $392,671. Even two different scripts would work for us. I want to drop this JS or html onto a page similar to the Doomsday clock as a shock value to those who aren't aware of how many pets have had to die so far this year or how many taxpayer dollars were spent to house, feed and adopt and/or kill those pets not adopted in our state. HELP! I know enough JS and HTML to be dangerous (as you can see from our website - http://www.tinylovingcanines.org) so as much as I search and try to build one myself, I can't get seem to make this project work. THANK YOU for any help!!! Is it possible to use Javascript to uncheck all checkboxes that appear within a specific div? I'm already using names/ids for each checkbox, and these are generated dynamically, so I cant really apply a group to all the checkboxes I want to untick. Hi, I'll explain my situation: I'm completely new to javascript so what i want to do is make a script that shows a specific div when the visitor is at the homepage but hide it when hes in another page of my website. i've read some people trying to explain it to someone else but it seems that i need to learn many aspects of the javascript language to edit it to my needs. I'm a med student and im really tight in my schedule and have almost no extra time to sit and read about javascript just so i can do this one specific thing. Would you please help me out? I've been trying to figure this out on my own for the past 3 days with no success. I will greatly appreciate it if someone helps me. PLEASE... Hi there! I've been searching for threads to solve my problem but I don't have the knowledge necessary to figure it out (you know, graphic designers....) so your help will be very appreciated!!! Here's the problem : I have a div named "cat" that I want to hide with a Javascript:animatedcollapse (slideup) action. The action is linked externally on another page. This is the line/link that hides it : <a href="javascript:animatedcollapse.hide('cat')">Hide the div<br/> It works fine. But, I want this action to happen at the same time that you press another link (that other link opens a page in an iframe). This is the iframe link : <p><a href="page.html" target="iframe">Open link in iframe</a></p> Both links work fine. But i want to merge the two together. How? Thanks in advance! Hi all, this is my first post so forgive me for any errors but i'll try and give all the information i can. i use Xara Designer Pro and i have used a 3rd party software to create a html menu however i have a html loading screen on my site and the menu always appears on top of the screen and while the screen is loading, this is the only thing that appears on top everything else is fine, i have put this to the people on the xara forums and the opinion is that its probably the JS file that the menu is using that is telling it to appear on top. i was wondering what i should look for to determin this problem or if someone could take a look at it for me? i'll upload the JS here and see if anyone can help. my site is at www.pcevo.co.uk however you need to CTRL + F5 to refresh wihtout the cache to see the loading screen if you are on a fast connection.
I'm creating a menu using html, css and a javascript, I found a tutorial to follow online. What I am trying to achieve is when the mouse hovers over the menu items, each item will have a different colour background. the problem is that i can do this but it only works with one colour and not different colours. this is the html: Code: <ul> <li><a href="1.php">Things</a></li> <li><a href="2.php">Animals</a> <ul> <li><a href="2-1.php">Cani</a> <ul> <li><a href="2-1-1.php">Domestic dogs</a></li> <li><a href="2-1-2.php">Wolves</a></li> </ul> </li> <li><a href="2-2.php">Felidae</a> <ul> <li><a href="2-2-1.php">Domestic cats</a></li> <li><a href="2-2-2.php">Wild cats</a></li> </ul> </li> </ul> </li> <li><a href="3.php">Humans</a></li> </ul> the css is as follows: Code: div#s1 { width: 200px; /* menu width */ } div#s1 ul { background-color: #036; list-style-type: none; /* get rid of the bullets */ padding:0; /* no padding */ margin:0; /* no margin for IE either */ } div#s1 ul li { margin: 0; padding: 0; background-color: #036; display:block; border-top: 1px solid white; /* lines */ } div#s1 ul li a { display: block; /* lines extend to right, make area clickable */ color: white; background-color: #036; padding: 3px 3px 3px 23px; margin:0; text-decoration: none; height:15px; /* hint for IE, alternatively remove whitespace from HTML */ } div#s1 ul ul li a { margin-left: 20px; /* indent level 1 */ } div#s1 ul ul ul li a { margin-left: 40px; /* indent level 2 */ } div#s1 ul ul ul ul li a { margin-left: 60px; /* indent level 3 */ } div#s1 li ul, div#s1 li.open li.closed ul { display: none; /* collapse */ } div#s1 li.open ul { display: block; /* expand */ } div#s1 ul li.open a { background-image: url(bullet_open.gif); background-repeat: no-repeat; } div#s1 ul li.closed a { background-image: url(bullet_closed.gif); background-repeat: no-repeat; } div#s1 ul li.leaf a { background-image: url(bullet_leaf.gif); background-repeat: no-repeat; } div#s1 li.active a { background-position: 0px -20px; color: red; /* highlight text */ } div#s1 li.active li a { background-position: 0px 0px; color: white; /* fix lower levels */ } div#s1 ul li a:hover { color: red; background-color: #06C; /* rollover effect */ } and finally the javascript: Code: var menu_active_class = "active"; var menu_leaf_class = "leaf"; var menu_open_class = "open"; var menu_closed_class = "closed"; //the default page that is displayed if URL ends in / var menu_default_page = "index.php"; var menu_url; //main function //menu_id : id of the element containing the navigation function menu_main(menu_id) { var url = location.href; if (url.lastIndexOf("/") == (url.length-1)) { url = url+menu_default_page; } if (url.lastIndexOf("?") >= 0) { url = url.substring(0, url.lastIndexOf("?")); } if (url.lastIndexOf("#") >= 0) { url = url.substring(0, url.lastIndexOf("#")); } menu_url = url; var main = document.getElementById(menu_id); if (!main) alert("No element with id '"+ menu_id +"' found"); menu_traverse(main); } /* Walks down the subtree and on the way back sets properties. returns bit set 1: set = element is a node, unset = element is a leaf 2: set = element contains the active node 4: set = element is the active A node */ function menu_traverse(element) { var props = 0; // walk down for (var i=0; i<element.childNodes.length; i++) { var child = element.childNodes[i]; props |= menu_traverse(child); // aggregate bits } // on the way back now switch (element.tagName) { case "UL": props |= 1; break; case "LI": var c1 = (props & 1) ? ((props & (2|4)) ? menu_open_class : menu_closed_class) : menu_leaf_class; element.className = element.className ? element.className+" "+c1 : c1; if (props & 4) { if (!(props & 2)) element.className += " "+menu_active_class; props |= 2; props &= 1 | 2; // reset bit 4 } break; case "A": if (props & 2) break; // once is enough var href = element.getAttribute("href"); if (menu_isSameUrl(menu_url, href)) props |= 4; break; } return props; } //matches two URIs when href is the last part of url //.. and . are correctly resolved function menu_isSameUrl(url, href) { var a = url.split(/[?\/]/i); var b = href.split(/[?\/]/i); var i = a.length - 1; var j = b.length - 1; while ((i >= 0) && (j >= 0)) { if (b[j] == "..") { j-=2; continue; } if (a[i] == "..") { i-=2; continue; } if ((b[j] == ".") || (b[j] == "")) { j--; continue; } if ((a[i] == ".") || (a[i] == "")) { i--; continue; } if (! (a[i] == b[j])) return false; i--; j--; } return true; } New to this forum but hope this will explain my problem, any help is much appreciated! thanks!! Jesper Hi. I've dynamically created some divs, how do I select a specific div to use? Code: //create box for length of letters in word var i = 0; for(i=0;i<wL;i++){ cBoxes = document.createElement("div"); cBoxes.className = "letterBoxes"; hangMan.appendChild(cBoxes); } So I'm creating the amount of divs equal to the amount of letters in my word (I'm making a hangman game). On correct guess, I need the letter to show in it's correct position (within the correct blank div previously created). I have the correct position stored in a variable (letPos), and the correct guess (userGuess), I need to show userGuess at the div equal to letPos, ie div 4 or div 5, etc. If I simply go cBoxes.innerHTML = userGuess, the correct userGuess always shows at the last position in my cBoxes divs. I need it to show at the correct position (letPos). Any hints? Hello, How do I run a script .onload, but only when the user is referred from a specific URL? Hi, The Problem I am trying to create a Google Translate widget on my webpage, with just one language pair, Latin to English. Unfortunately the Google Translate AJAX API only supports a subset of all languages available, and Latin is not included. However, Latin IS included on the Google Translate website. Apparently languages that are in beta are available there, via a different server, while only fully released languages are available via the AJAX Translate API. My Attempts at Solutions a) I wrote a script that generated the XMLHttpRequest() call to the server the Google Translate website uses, but it always returned a '0' status code. I have since found out that this is normal, as these kinds of calls can only be made between pages on the same server. b) I then wrote a script that created a popup, and used the baseURL+params for the URL, , and this produced a pop-up window containing the translation result. However, as that page came from a different server to the server containing the script, I could not access the results on it. The code for that is he Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,locationbar.visible=false,status=0,menubar=1,resizable=0,width=500,height=400,left = 710,top = 400');"); window.focus(); } // End --> </script> </head> <body> <form> <input type=button value="Open the Popup Window" onClick="javascript:popUp('http://translate.google.com/translate_a/t?client=t&q=vicecomes&sl=la&tl=en&pc=0')"> </form> </body> </html> c) So, in final desperation I wrote a small script with an IFrame in it that shows the Google Translate webpage, using this code: Code: <iframe name="frame1" src="http://translate.google.com/?sl=la&tl=en#la|en|" frameborder="0" scrolling="auto" style="width:100%;height:280px;"></iframe> The result can be seen here (click on the Latin-Help tab): http://www.blanshard.org/ Not too bad. Now I would like to just to tidy this up (until Latin comes out of beta and is moved to the Google Translate AJAX API server) I would like to move the Google Translate page up a few px so that the top menu does not show, and disable the scrollbars, so I am just framing the Translation box and result area. It appears that the top-left corner of the called page always aligns with the top-left corner of the IFrame, but I want to add offsets. Is it possible to offset the called page anywhere within the IFrame so I can frame just the part I want? Thanks for any help, Wibs Hey. I have a string and I can return say, the fourth letter with output[3], but i can't assign a value to it for some reason: I am trying to make hang man Code: <!DOCTYPE html> <html> <head> <script src="jquery.min.js"></script> <script> $(document).ready(function(){ var word, output, wordLength, stringLength, newLetter, letters; var i, n, k, health, wcheck; word = "word"; output = ""; letters = ""; wordLength = word.length; for(i = 0; i < wordLength; i++){ output += "_"; } $("#inputLetters").keyup(function(){ newLetter = $("#inputLetters").val(); $("#inputLetters").val(""); letters += newLetter; wcheck = false; for(i = 0; i < wordLength; i++){ if(word[i] == newLetter){ wcheck = true; output[i] = newLetter; } } if(wcheck = false){ health++; } $("#letters").html(output + "<br />" + letters); }); }); </script> </head> <body> <span id="letters"> </span> <br /> <br /> <input id="inputLetters" type="text" /> </body> </html> Hello, First I would like to say I am not a coder. I would like to have a specific date range in years entered into a text box and if anything else is entered a pop up alert would appear. The date range would be from 1912 to 2002. Any help with this would be greatly appreciated. I am using Joomla 2.5 and a form constructor called RS Form Pro That allows JS to be used. This is the Javascript I am trying to use: Code: <script type="text/javascript"> function checkDate(theForm) year=document.getElementById('YearBorn').value; if(year<1912 || year>2002) { alert("registration is restricted to those born between 1912 to 2002"); return false; else { return true; } } </script> This is how I am trying to call it Code: onblur="return checkDate(this);" I am not sure if I am calling it correctly or if the JS code is even correct. When the user enters the date and it is not within the date range I need the alert to pop up. Thank you for any help you can provide DeZiner |