irt.org logo

Home What's New Articles FAQs
Bulletin Board Reviews Downloads Search

All the JavaScript Frequently Asked Questions
  • How do you check if a date is valid?

  • How can I calculate the number of days elapsed between two dates?

  • How do you change the URL of a frame by typing in the URL in a text box of a different frame?

  • Is there a script out there that will load a certain frame first?

  • Why does Netscape show the source of the *.js source file?

  • How do you force JavaScript to display the .00, or in the case of 50 cents display .50 instead of .5?

  • How do you round a number to a X decimal places?

  • Is it possible to output a number e.g. 1234567 as 1,234,567?

  • How do I make a button that when clicked displays a message in a field?

  • How do I set and access the value of a hidden form field?

  • How can I click on a thumbnail in one frame and load the image in another?

  • How can I get JavaScript embedded in a table to work?

  • How can I password protect a page?

  • Does Internet Explorer 3.x support cookies?

  • How do I pass a month from a drop down list to a field on another page?

  • How can I compare a date in a string with todays date?

  • Where are the official online JavaScript documents?

  • Where does the target="" go when using location.href=""?

  • How do I read data from an input file using JavaScript?

  • Can I have a Javascript counter without the need for CGI or counter providers?

  • Can I detect the language set in user's browser?

  • How do you debug Javascript?

  • How do you pass an option from a drop down list from one form to a field on another form?

  • How do you count the number of images on a page with javascript?

  • How can JavaScript find information about the contents of another frame?

  • How do you load two pages automatically, in separate windows?

  • How can I submit a form which has more than one text field by just pressing enter?

  • How do I preload an image?

  • How can I caclulate someones age in years, months and days?

  • Is it possible to set the font in a textarea?

  • How do I include carriage returns in a textarea?

  • How can I create a message window using the open command?

  • How do I get a value from a dropdown menu, and use it to change the location of another frame?

  • How can I display today's date on my home page in the following styles...?

  • How do I get the x,y position of the image clicked to return?

  • Is it possible to load several predefined www pages into one window sequentially?

  • How do I embed single and double quotes within a string?

  • How can I have a conditional link that will work on all browsers?

  • Is there a simple way to test if a variable is a number, e.g. test for entries like "1234a6789"?

  • When I open a new window, how can I change the contents of the original window from the new window?

  • Can I write directly to a frame, after defining the frameset?

  • How do I detect the version of JavaScript the users browser supports?

  • How do I detect the browser the user is using?

  • How do I redirect browsers that do not support JavaScript?

  • How do I stop a form from being submitted?

  • Which browsers support JavaScript *.js source files?

  • Which browsers support the JavaScript image object?

  • How do I sum form field values together?

  • Can I print the current page?

  • How do I show a customized message based on the time of day?

  • Is it possible to use multiple .js files in one HTML document?

  • How do I check if an image file exists?

  • How do I call a function in another frame?

  • How can I tell whether the document is loaded within frames?

  • How can I stop a link being loaded?

  • How can I open two pop-up windows?

  • How do I set one frame to have the focus?

  • How can I make the lastModified date more readable?

  • How do I get borderless frames?

  • How do I swap images within tables?

  • Which JavaScript events can be captured over the form type 'image'?

  • How do I code if-else-if?

  • Is it possible to import a .js file from another .js file?

  • How do I pass parameters to a JavaScript script defined in a file?

  • Whats the difference between _top and _parent?

  • How do I get a pop-up window to always stay on top?

  • How can I control the width of a select box?

  • How do I change the forms action property?

  • How do I access to the part of the URL after the "?" character?

  • How do I check if a forms checkbox has been checked?

  • Why won't the form submit() method work?

  • How can I prevent the links from working until all the images have loaded?

  • Is there a way using javascript to have a button on a page with frames print a specific frame?

  • Is it possible to preload a frame without showing it?

  • How can I append a stock symbol from a form to a URL to load four documents in a frameset?

  • How do I access a variable within one nested frameset from another?

  • How can I have an onMouseOver event handler on an image in a form?

  • How can I pass the entered values on a form in a popup window to a form on the original window?

  • How can I store the form field values so I can use them again later?

  • How can I pass checkbox/radio value to another page?

  • How can I get the JavaScript function that reloads the page to wait until an image has fully downloaded?

  • How do I force a reload/refresh from the current page?

  • How do I detect the version of JavaScript the users browser supports, and then divert them to an appropriate page?

  • Is there a way to close a child window after I click the submit button?

  • Can I store a gif image and a background code/or name in a variable and load it on to a frame using the document.write() method?

  • How do I display a popup window when an image is clicked? Can you do this in an image map also?

  • How do I include one html/text file within another?

  • How can I change the location of two frames using a simple '<a href="">'?

  • Can I show tabular data without using tables?

  • Is there a way to open a new window using the window.open() method so that the window opens to a specified size?

  • It is possible to activate a text input type box when one of two radio button is checked?

  • How is the "return" reserved word used?

  • How can I redirect a visitor to separate pages, keeping the domain name they came in with based on the referrer?

  • Why do I get an error message when trying to find the location Hf the document in the parent or sibling frame from another frame?

  • Where do I place target="Main" in the following code?

  • How do I redirect to another page after 5 seconds using JavaScript?

  • How can I do a multiple choice quiz?

  • How can do you close a child window when your site is unloaded from the parent window?

  • How can you display how many years, months & days are left until 31/12/1999?

  • How can I add diacritical letters such as è to a textarea?

  • How can I read and write to a text file by JavaScript?

  • What is <span>?

  • Can I place the document in one of the frames as the main document when removing frames, if the document is from another server?

  • The answer to the last question got me thinking. The actual URL of the bottom frame must be stored somewhere as a variable so that the browser can go back to the previous URL in the bottom frame. How can you get this URL?

  • I see on you web page that you can download you site for viewing later. Could you tell me how I would set up similar for part of my web site?

  • Looking for a good simple JavaScript counter?

  • How do you kick off a function with a mouse click on an image?

  • How do you make a message scroll at the bottom?

  • I am thinking of learning Javascript as it would appear to be extremely useful and effective. However, I have no previous programming experience other than HTML. Do you think this is feasible or is it too ambitious?

  • I have three frames on my page, how can I control how far down the horizontal window split goes?

  • How when I click on the textBox do I set the focus to the checkBox?

  • How do I use an automatic redirection script or META tag to open a page in a frame, and keep refreshing it every 10 seconds?

  • How can I show images that swap, of use a Java applet or use plain images depending on the browsers capability?

  • Is it possible to resize a frame by script using resizeTo() or resizeBy() functions or innerHeight properperties?

  • Do you know how I can detect the users choice in the "preferred language", in Netscape Communicators preferences?

  • Is it possible to set up a JavaScript that will display a random bit of text at the bottom of a web page ("quote of the day") that changes either on each visit or each day?

  • Can I "execute" function test() from frame2 by pressing button (onClick) in frame1?

  • How can I popup a window with an image in it using onMouseOver on either a word or an image?

  • How can I change the background image?

  • Is it possible to highlight the text of a link using onMouseOver?

  • Is it possible to address the frame structure from outside of itself, from an opened child window?

  • How can I validate the imput to an text entry field for valid email address?

  • Upon loading a page with a form, is it possible to set the focus to a form object, e.g. "User Name" Textbox?

  • What's a good way to enter form data for a phone number?

  • How do I pre-load a page?

  • How would I be able to force all incoming pages to appear within the specified frame (many pages have _top or _parent target parameters)?

  • How do I prevent IE3 from submitting a form when the user presses enter in a field?

  • Is it possible to have a form perform a different action depending on what is selected in a drop down list?

  • How can preload the contents of the next document to be shown in the current frame?

  • Is it possible to determine the type of a form element in JScript version 1?

  • How do I add form elements together, I have tried many different ways but I always either get NaN or a concenated string (ie 15 + 16 + 1 + 52 = 1615152 != 84)?

  • Is there a maximum string length?

  • How do you make a text link read "Naht S'wew?" and Then OnMouseOver change to "What's New?"?

  • Is it possible to send an email from a JavaScript?

  • I know how to focus on a specific element but how do I know want is currently focused?

  • How do you hide the real address of a page?

  • Are there any books that you suggest?

  • How do you get a two character abbreviation from a drop down list of all the US states as input to a CGI?

  • Is there a way of automatically displaying to users when each document of the site was last updated?

  • Is there a way of telling which language the users browser is using?

  • How can I open a new window by passing the width and height as parameters from a JavaScript function?

  • How do I tell if a window that I have created in JavaScript is still open?

  • How do I parse the referrer, in order to forward the browser to the appropriate page?

  • How can I find out which sites has a client visited just before he entered my page?

  • How do I alter the HTML source of a layer in Internet Explorer?

  • How can I convert a decimal number into a hexidecimal number?

  • How do you subtract X hours from a date?

  • How do I change selected parts of the text on the page?

  • How do I change selected parts of the HTML on the page?

  • How do I change text within table cells?

  • How can I set the contents of one of the frames of a frameset when loading the frameset?

  • How do I protect documents so that they are only accessible after entering the correct user id and password?

  • How do I load a document in another frame when a button is clicked?

  • When using a source file, is the code loaded into the cache, or does it need to be reloaded with each page that calls it?

  • What does "return false" do? When is it necessary? When is it not?

  • How can I submit a text field so that after pressing "return" or clicking button it would be possible to jump to another URL page, containing the description of that word entered in the text field?

  • Is there a way for me to validate a form BEFORE submit so it will never arrive at the page?

  • How can I create a window on the initial loading of a page, but keep it hidden until it is used?

  • How can I change the focus from one window to the other window (and vice versa) by clicking on an link or image, but keep both windows open?

  • Can you access global variables (such as MyName) from a different page than where it is held?

  • Why does document.referrer not work correctly in IE 3.02? It will return the CURRENT page instead of the referring page in 3.02, but works fine in IE 4.0 and Netscape. Bug or what?

  • How can I get and/or set the content of a user-filled field?

  • How can I make a frame pop in on a button click and pop out on a different button click?

  • How do you make make form submission conditional on returning true from more than one function?

  • How do I access variable values and form field values across windows?

  • Is there a way to write from a window I opened back to the one that opened it using a document.write?

  • Is there any way that I can have multiple onLoads in my body statement?

  • How can a form button take you to another page?

  • When using an image input type in a form how can I perform form validation on form submission?

  • How do you add a number of months to a date and then format the output?

  • How can I implement a Search capability to find a word in the current document using Javascript?

  • How can I show a different explanation for a link in the status bar as opposed to http://www.somewhere.com?

  • When changing the contents of two frames at once, how can I ensure that the back button changes both frames at once?

  • How do you bookmark a frame within a frameset, but making sure that the bookmark returns the visitor to the frame within the frameset?

  • How can I write the contents of a textarea to another frame whilst retaining the line breaks?

  • How can I submit a form using a normal image link?

  • How can I use the location replace method without causing problems in browsers that do not support it?

  • How can I use the void method without causing problems in browsers that do not support it?

  • How can I move a layer using an onMouseOver event handler?

  • How can I position another frame on an anchor?

  • How can I make a new variable with a name based on the value of another variable?

  • Where can I find information on Microsofts JScript?

  • How can I format a number, e.g. 2, as 02 and 00002?

  • Is there a way to set the base target for a frame to parent.opener?

  • How do I change the cursor in MSIE4?

  • Is there any way of sending an email using a form and moving to another page at the same time?

  • How do I automatically submit a form after a timer function expires?

  • Is there a way to access the links in a document with javascript?

  • How do you sort a number of lines of information in a textarea?

  • How do you combine two forms before submitting them as one form?

  • How can you control midi or wav files using JavaScript?

  • Can I replace form buttons with something more interesting?

  • Is there a way, using javascript, to do an onMouseOver on text, i.e. not a link and not an image?

  • How can I adapt the previous script so that a window opens and closes on onMouseOver and onMouseOut?

  • When creating a textarea in JavaScript how can I make sure each line of textappears on its own line?

  • How can I have two submit buttons with different actions in one form?

  • How do I detect if text has been entered on a text input before the form has been submitted?

  • How do I open a window at a given position on the screen?

  • Is there a way to force a page to reload even if the browser option has been turned off?

  • How do you check that a selection in an options list has been selected?

  • What does the floor() function do?

  • How can I make a link text go bold on mouse over, but only in browsers that support it?

  • Is there a way to use JavaScript to navigate to anchors within the current page using a drop down menu?

  • How can I add a method to an object?

  • How can you format numbers as right-aligned in a text field?

  • A site that uses frames displays my site in a frame, is there a way to keep my site 'on top'?

  • How can I put a message in the status window when the mouse is over a link, but after a certain length of time change the message to display the URL specified in the link?

  • How can a user enter their email address in a form and then have the email sent to themselves?

  • How can I check where a visitor has come from?

  • I keep receiving function undefined in the following script, why?

  • Why when using a form input type of "image" is the onClick event handler ignored in Netscape?

  • Is it possible to maximise the current window?

  • How can I open a new links window and have the links opening in the main window?

  • How do I stop a popup window from opening?

  • Is it possible to close the parent window (main web browser window) from a child window?

  • In a popup window how can I submit a form, close the popup window and target the results of the form into the main window?

  • How can I calculate the difference between two dates?

  • How can I copy multiple options from one options list to another?

  • Is it possible to submit a form with a mailto: action using JavaScript?

  • I have a frameset with four frames, when I press button in frame1, how do I get two frames (frame2 and frame3) loaded at a same time with different pages?

  • How can I change the location of the main window once a document from another server has loaded?

  • How can I open a window which will always stay on top of all browser windows?

  • How can I make a different image appear when an image is clicked?

  • How can I change an image in another frame using onMouseOver?

  • Is it possible to select a portion of a mapimage and have some text appear in another area of same page?

  • How can I avoid 'presistant frame caching' when I use dynamic pages in my frames?

  • How do you target links into a frame within a new windows opener?

  • How do you calulate the Julian day number of a date?

  • How can you filter multiple words in an array and replace them with other words?

  • How can I use an image onMouseOver event to load a new window, without an image click changing the location?

  • How can I close a popup window after, say, 5 seconds?

  • Is it possible to trap the mouse moving?

  • Is it possible to trap control key presses?

  • How can I trap errors?

  • How can I submit a form which has more than one text field by just pressing enter, but how do you make everything work if the user isn't running javascript?

  • How can I show a different image each day?

  • How can I change the contents of a drop down select list?

  • How can I convert a form field value in HH:MM:SS to pure seconds?

  • How can I check if the browser is Opera and which version?

  • Is it possible to dynamically alter the size of a window after it has been created?

  • How do I strip leading and trailing blanks off of a string (without writing a function to treat character by character)?

  • How can I replace diacritical characters?

  • How can I replace HTML entities with the appropriate characters?

  • How do I tell the browser not to save the current URL in the history folder?

  • How do I get all buttons to be same size?

  • The onLoad event handler does not always set the focus in a form field, are there any workarounds?

  • Do the values of variables in JavaScript *.js source files last through a frame/document reload?

  • How can I maintain two drop down menus so that a change to one is reflected on the other?

  • How can I detect the users browser and then redirect them to a suitable page?

  • How can I close a window as soon as the document starts to load?

  • How do you access the images in a layer in Netscape?

  • How can I safely detect whether the browser has Java enabled?

  • How can I control a Layer in Netscape 4 so that it is always positioned in the same location on the screen regardless of where in the document the user is currently located?

  • How can I control a 'layer' in Explorer 4 so that it is always positioned in the same location on the screen regardless of where in the document the user is currently located?

  • How can I combine the previous scripts so that a layer in either Netscape 4 or Explorer 4 is always positioned in the same location on the screen regardless of where in the document the user is currently located?

  • How can I show the documents last modified date in the format: month, date, year, time(GMT)?

  • How can I detect when a visitor is leaving my site?

  • When attempting to detect for MSIE 3 using parseFloat(navigator.appVersion) it always returns 2, why, and what can I do about it?

  • Is is possible to trap Shift and/or Ctrl key sequences?

  • When clicked, MSIE4 puts a selection rectangle around an image link that stays there even after the script finishes. How can I get rid of it?

  • How do you return the results from a query into a new window?

  • How can I set the document title in JavaScript?

  • How can I target the main browser window?

  • How can I target another window when using a drop down menu?

  • If I have two identically named submit buttons, but with different values, how can I tell which one was pressed?

  • How can I clear the form field values after the user has submitted the form for client side processing?

  • Can JavaScript read text files?

  • How do I work out the date seven days before a text string mm/dd/yy?

  • How do you convert an integer to a string?

  • Can JavaScript write to a file on the server?

  • Does MSIE 3 support JavaScript *.js source files?

  • When a page is reloaded how can it check that any window it previously opened is not still open before attempting to open it again?

  • Is it possible to have an image which is not an active link unless the ctrl key is depressed when clicking?

  • How do I make an image move across the page?

  • Can I create a link without having a hand pointer?

  • How do I call two functions from the body tags onLoad event handler?

  • How do I capture what the user entered when using prompt()?

  • How can I reverse text in a form field?

  • How can I ROT13 text in a textarea?

  • How can I capture a login name and password in a popup window and then pass it onto the next page?

  • How can I tell when Daylight Saving is in effect?

  • How can I preload images into the browser cache, but only one at a time?

  • Can I access the browsers find and copy controls?

  • How can I redirect the browser using a text box?

  • How do I detect what screen resolution a browser is using?

  • In NN you can detect if Java is enabled with navigator.javaEnabled how can you do this in MSIE?

  • How do I display a random banner image?

  • How can I detect with frame 1 if frame 2 is completely loaded?

  • How can I calculate subtotals, tax and totals on prices of products without producing rounding errors?

  • Can you use JavaScript to reset your form elements when a user clicks on their Browser Back Button?

  • In a form one with only one text field how can you ensure that the form is only submitted if the submit button has been pressed?

  • How can I validate a form and if necessary prompt for the proper values, and then still validate the new input before submitting the form?

  • How do I detect whether the document is in a frame?

  • How do I detect whether document has any frames?

  • How do I redirect the browser depending on whether the browsers supports JavaScript?

  • How can I alter a link so that if the browser supports JavaScript the user is taken somewhere else?

  • Is it possible to click on a link in one frame, that opens one document in one of the frames, and another one in the remaining frame?

  • How can I pass a complete absolute url from one page to another?

  • When referring to my form using form.field.value it does not work, why?

  • How can I make the lastModified date more presentable and include the time as well?

  • Does setYear work correctly if it is given a two-digit year?

  • Is there any way to prevent a user from making any form entries, i.e. changing a pull down list selection, or typing text into a text field?

  • How can I force all characters to be uppercase before the user submits the form?

  • Can JavaScript show graphs?

  • Is there a Navigator equivalent html tag for Explorer's <marquee> tag?

  • Is there anyway in JavaScript to force the browser to reload the html page from the server and not from the browsers cache?

  • Is there a way to have a Pop Up window ask for a Name and Password and then send this infomation to a cgi script?

  • When using window.close() some pages ask 'Close Window? (yes/no)' and others don't, why?

  • MSIE3 doesn't seem to recognize opener in a pop-opened window, what do I do?

  • Is it possible to detect when the window has been resized?

  • How do I disable the "Back" button of a browser?

  • What is the simplest script for selecting an option from a drop down list and loading the page into another frame without a button?

  • Using an Image Map and mouse overs is there a way to highlight that clicking the image will actually do something, other than using status messages?

  • How can I click a button in another frame that simulates clicking a button in another frame?

  • How do I change the content of a frame in another window?

  • How can I close the window from within a frame?

  • How can I extend your redirecting access within frames article to use three frames?

  • When opening a new window containing a frameset, how can I ensure that one of the frames is opened at a particuar anchor?

  • How can I load a popup window when a user leaves my site?

  • Where can I get information about image rollover/mouseovers/highlighting/swapping?

  • Can I use JavaScript to lookup information in a META tag?

  • Is there a solution for the window.open problem with MSIE4?

  • Is it possible to combine forms and replace() so that the form submission does not create a history entry?

  • When attempting to change the location of a frame in a window that has just been opened it sometimes fails with window.frame has no properties, why?

  • How can I make a script that will automatically reply an e-mail?

  • How can I extract the X and Y coordinates from an image map, and use then to perform further processing in the current document?

  • How can I place a delay between onMouseOut and the swapping back of the image?

  • How can I detect when a frame in a frameset is resized?

  • When trying to access information from a page from another server I get "access disallowed", how can I get around this?

  • How can I create a modal window in MSIE4?

  • Whats the difference between ASP, CSJS and SSJS?

  • Is there any way to specify that you want only numbers allowed in a text box?

  • How can I load another document in the current document in MSIE?

  • How can I cycle through several HTML files with timeout a set between each page?

  • Is there a way to automatically put focus on the next input text field and continue to have to user typing when the previous input text field is full?

  • How can I change dynamically change the map associated with a client side imagemap?

  • How do I make a popup window from a dropdown menu?

  • How can I submit a form on a popup window and target the results into the main window and close the popup window at the same time?

  • How can I submit a form on a popup window and target the results into the main window and close the popup window at the same time, even if the location of the main page has changed?

  • Can I change the location of two frames with just one click?

  • How do I sort a 2-D array on element N of each 'subarray'?

  • How can I close a window after 10 seconds unless the mouse has moved, in which case I should suspend the closure for another 10 seconds?

  • How do I randomly generate an integer between two limits, i.e. 1 to 10?

  • How can I place the date and time that a form was displayed into a hidden form field?

  • How can I make a generic function that opens up windows using the url, window name that I pass, which correctly defines the opener as the current window?

  • Does MSIE4 support the image object?

  • How can I allow the user to confirm before printing a page?

  • How can I ensure that a string only contains characters that I want?

  • How can a button in a popup window, change the main window so that the current page in the main window is reloaded into a frameset?

  • Why does JavaScript code continue to be interpreted even after I've requested that another document be loaded?

  • How can I detect a Mac computer and use a larger font?

  • How can I detect and verify the domain name that someone has used to access my site?

  • Why won't my browser play sounds?

  • How do I format a form field 10 digit only numeric string to conform to the specific phone number format 123-123-1234?

  • Is there javascript code to pre-download an image?

  • Can I grab the selected text from a page?

  • How do I access a form field which has a non alphanumeric name?

  • Why when writing into a popup window does IE return with 'Access is denied'?

  • Why can't I set the form values to some setting other than their default setting when using a forms onReset event handler?

  • Is it possible to validate both a pull down menu and a text area when a form is submitted?

  • How can I change the effect of a link tag so that Netscape and Explorer go to different locations?

  • Is it possible for a character sequence of a/ to be combined into the aacute diacritical character?

  • Is there an easy way to change a decimal number string (i.e. .5, .25) into a percentage (i.e. 50%, 25%)?

  • Is it possible to make the browser do two things on a OnMouseOver command?

  • How do I create a multi-dimensional array in Javascript?

  • How can I avoid the confirm message when closing a window?

  • How can I open get a new window to pop up when the mouse rolls over a certain plain text word?

  • How can you display how many days are left until 31/12/1999?

  • How can I pass the name entered in a text box to a popup window for display when the form button is pressed?

  • How can I display a confirm box when a user unloads the page?

  • How can I access the value of a form field in the 2nd frame from the 1st frames popup window?

  • How can I make one submit-button post two different form to two different urls?

  • How can I check that a text box entry is empty or has just spaces?

  • Is it possible to nest a button inside a form and have this button execute a different cgi, passing the appropriate name/value pairs?

  • Has JavaScript always been called Javascript?

  • How do I make an image bounce off the edges of the browser?

  • How can I access the value of a variable set on a different page - when I have to go through an intermidate page first?

  • How can I have two submit buttons with different actions in one form?

  • How can I have a popup date selector return dates to different form fields?

  • How do I find if a particular frame exists before attempting to use a function inside that frame?

  • Is it possible to detect from outside a floating frame that the contents have loaded?

  • What is the best way to clear the contents of an array prior to repopulating it?

  • How can I play a wav file when someone clicks on a link which at the same time changes the current page?

  • With a button located in frame1, how do I change the contents of both frame1 and frame2 when it's clicked?

  • How can I change the current location after successfully submitting a form?

  • How can I make the links target the main frame?

  • On which browsers and versions will JavaScript work correctly, and how do I restrict the running of JavaScript based on the JavaScript version the browser supports?

  • How can I access a form field which has a non alpha name?

  • How can test for the existence of a function in another frame?

  • How can you make a .wav play when you click on an image?

  • How do I use an image button in JavaScript to submit a form in a different frame?

  • How can I direct the location chosen from a dropdown menu to a new page?

  • How can I display every JPG image in a defined directory as a thumbprint image that when clicked brings up the image in full?

  • How can I prepare a link so that it already has escape search text?

  • Is there any way in JavaScript to clear the users cache before they begin to load my page?

  • How can I have image buttons that remove and reload the frameset?

  • Can JavaScript do 'dynamic outlines' (like windows explorer) that show the sub-sections when you click on the sections and hide them again when you click the second time?

  • How can I with a click on a button in a window, open a new window, setup a frameset in the new window and write text to the frames, all from the same JavaScript?

  • How can I use a variable to dictate which *.js source file is loaded?

  • How can I load an image into a main frame when the mouse moves over a link in another frame?

  • Is there any way to use a JavaScript for password protection without the password being visible anywhere in the source code?

  • Is there a way to perform a JavaScript function when a certain button (specifically the left or right arrow key) is pressed?

  • How do you get a page to perform something only on the initial load, and not when reloaded? Is it done with cookies?

  • Is there a way that a button can be kept from reloading a frame again until the frame is reloaded?

  • How can I load a page within a page when a button is pushed?

  • Is it possible to dynamically remove window options?

  • When I use a normal text link to open a popup window the main window is also affected - how do I avoid this?

  • How can I change a value on a form on the original window from a button in a popup window, submit this form, and close the popup window in one step?

  • How can I select a US state from a drop down list and have the 2 character abbreviation appear in a text box?

  • How do you hide and reveal the article synopsis' on irt.org?

  • How do I stop old versions of netscape (pre 3) and IE (pre 4) from giving errors due to them not seeing *.js files which define functions used later in the page?

  • How can I write HTML-text into another frame from JavaScript - rather like a status window?

  • How can I return the text values from a multiple select box back to a form on the opener window?

  • Can you use an imagemap with onMouseOver and onMouseOut, if so, what is the proper syntax?

  • How can I vet radio buttons so that if all the answers are 'yes' the form loads another page, but if even one answer is 'no' the form results are passed to a cgi script instead?

  • How can I force JavaScript to reload an image from the server if the image already exists in the browser's cache?

  • How do I link from the main window to a named link within a frame within a pop up window?

  • When using a drop down menu, how do I store the value selected in a variable?

  • How can I change the href property of a link in another frame?

  • How can I copy just just the letters and only one of each from one form field to another?

  • What is the difference between writing a Javascript into <HEAD> </HEAD> and <BODY> </BODY> tags?

  • How can I get the results of a form submission to be displayed in another frame?

  • How can I have an image toolbar where the images remain clicked in when the document has loaded into another frame?

  • How do you convert a character to it's ascii value without using the V4 browser compatible charCodeAt()?

  • How can I read client-side files or upload them to a server using JavaScript?

  • How can I change the mouse pointer to an hourGlass prior to long running scripts, then reset after the script complete?

  • How do I swap two images that are not of the same size?

  • How can I close the current window after opeing a new popup window?

  • How can I make sure that when I return to a page it always loads the latest version from the server?

  • How can I highlight text links in table cells?

  • How can I post form results to multiple windows depending on the submit button the user clicks on?

  • Is it possible to disallow a pop-up window to be maximized?

  • How can I open a window so that the window always opens in the lower right-hand corner of the screen regardless of the screen resolution?

  • How do I tell which button submitted a form?

  • How can I redirect the browser to the users homepage?

  • How do I amend the title of the current document?

  • How can I have text links in a table that show different images to the left of the links when the mouse pointer moves over them?

  • What's the difference between Java and JavaScript and why should I prevent my browser from executing JavaScript?

  • Why can't I get the selectedindex of a select form field?

  • How can I get rid of the page border in Netscape without resorting to using frames?

  • Why do links to anchors in tables only go to the top or the bottom of the table?

  • How can I hide the JavaScript source code from "view source" function of the browser?

  • Can you use JavaScript to send emails?

  • How do I link an image to several different .wav files, depending on which one the user has selected in a list box?

  • How can I make sure that people correctly view my pages in the required framesets and not on their own?

  • How can I close several windows that I opened with window.open?

  • How can I find out if a web page is currently up, before I redirect to the page?

  • Do you know how I can detect when a frame in a frameset is resized?

  • How can I redirect the browser to the next page after 5 seconds, but not before the page has loaded?

  • How can I use JavaScript to scroll the current page or a page in another frame?

  • How can I use JavaScript to find the day of the week for a given date?

  • Is there a way to close a window without that confirm message?

  • How can I play a random midi file when the page opens?

  • How can I tell if a URL exists?

  • How do you hide the real address of a page?

  • How can you redirect the browser to one page for MSIE and another for NN?

  • Is it possible to make select object form hidden?

  • How can you show a predetermined image for different days, but where the image filenames aren't consecutive?

  • How can I show a different background image depending on the browser?

  • Can JavaScript detect when a form has been successfuly submitted and processed?

  • Can JavaScript show rotating banner adverts?

  • Can I copy the input to one form to several others?

  • Can I make links that aren't underlined?

  • How you destroy a layer created using new Layer()?

  • How can I invoke another instance of the browser with a specific URL?

  • Is there a way to control the tab-sequence of fields in a form?

  • Is there some way to load a different home page each time someone comes to the site, or cycle through several different versions?

  • How can I detect the hour of the day, and then when someone selects a link, they go to either a "day" page or a "night" page?

  • How do I get the dates of next seven weeks in advance, e.g. if I want to display dates in the following manner: 5/11/98 to 5/18/98, 5/19/98 to 5/25/98 and so on for the next seven weeks?

  • How can I data/time stamp a form field as the form is submitted?

  • How can I simulate the tab key when the enter key is pressed?

  • How can I redirect a page depending the date, for example: automatically, monday I redirect to monday.htm and sunday I redirect to sunday.htm?

  • Is it possible for a script to check for frames and if present, get rid of them?

  • How do I script back and forward history buttons in a remote control new window that effect the main window?

  • Is it possible to pop-up a window the same size as the image it contains?

  • How can I get a text entered in one text field copied in realtime to another text field?

  • Is JavaScript the same as Java?

  • What is JavaScript?

  • How do I detect the resolution of the visitor's monitor and redirect him to another page?

  • How do I pass the value of a text field when the submit button is pressed onto the next page?

  • Can I print the current page using JavaScript on both NN and MSIE?

  • Is there any way to use JavaScript to detect plugins?

  • Is there a way of the form page returning to a thank you page after it has submitted the results to a cgi script?

  • How can I scroll a page automatically on mouse over?

  • Is there any way to associate a sound on mouse over?

  • How do I open another window from within a child window?

  • Is there some intelligent way to sort document.formname.selectname.options array by text/value so that selected option (or options) remains selected?

  • How can I pass the contents to be loaded into a "generic" frameset definition?

  • How can I provide a simple search facility on a page using JavaScript?

  • Is it possible to determine the pixel coordinates of the mouse in relation to the screen when passing over a link, and then open a popup window in that position?

  • Is there any way of knowing the URL of the next document to be opened from within an onUnLoad event?

  • Is there a way to have the windows self focus but blur when if there is input?

  • Using JavaScript how can I refresh the current page?

  • Is there a demand for JavaScript Programmers?

  • Is JavaScript used only to make web pages better?

  • Will learning JavaScript make learning Java any easier?

  • How can I show an image but only in browsers that don't support or have JavaScript disabled?

  • Do you know of anyway to have JavaScript retrieve data from a .txt file located on the server?

  • How can I maintain the original referrer to a site so that if need be the user can return?

  • Is it possible to list all inherent properties and methods of a given JavaScript object such as one used in an embed tag?

  • Is there any quick non-recursive) sort in JavaScript?

  • How do you keep people from downloading your graphics?

  • How do you handle runtime errors in JavaScript?

  • How do I get the time on the server, and not on the client computer?

  • How can I reload the current page and change the background and foreground colors?

  • Is there any way to use JavaScript to force page breaks on a printer that is printing HTML from a browser?

  • How can I capture and handle all "click" events in a document?

  • How can I print a page which is not the current page, without showing it?

  • How can I load a popup window when a user leaves my site, even if the user types in a url, selects a bookmark, clicks on the back button, or selects a url from the history?

  • Can I use JavaScript to parse the HTML on a page, for example, if I know there's a table on a page, can I extract out that table and display it alone, say with a different background, title, headings etc?

  • How do I know which frame has the focus?

  • How can I validate that a check box has been selected, or that one of several radio buttons has been selected in a form?

  • How can you target the opener window by name using a normal HTML link?

  • If all of my declared JavaScript functions are in the parent frame, how can I call those functions from another frame?

  • How can I force a layer to stay at the bottom of the browser window (NN4), whenever this window is maximized, or resized?

  • How can JavaScript remove "NEW" on the links automatically?

  • How can I set the mouse pointer to an HourGlass after I tab from a text field?

  • How can I join all the keys values in a hash array?

  • How do I pass an text from a text field to a function so that it displays on the status bar?

  • How do I change the size of the font in JavaScript?

  • Can I change the selection in the select box by clicking on a link?

  • Is there a way to display the value of a variable (such as a text string) on the web page without using document.write (which clears the page) or one of the aestetically unpleasing "box" solutions--writing into text boxes, alert boxes, etc?

  • How can different selections in an options field open in different frames and windows?

  • Where can I get more information regarding "hidden frames" is there any site where I can get more information?

  • Can I connect to an ftp server and download a file from there just using JavaScript?

  • Can I create http connections to a url and exchange information just using JavaScript?

  • How can I refresh the mouse pointer after a link is clicked so that it returns to it's normal state?

  • How do I change the pages in two frames when I click a button in a third frame?

  • How I can restrict the history of a window to one location?

  • My variable 'dir' doesn't work in MSIE4, aren't browser vendors supposed to follow some sort of standard?

  • How can I capitalise the first letter of every word using JavaScript?

  • How can I make sure that options selected from a drop down list open up the selection in the current frame if they are local files and opened up in the top frame if they are remote files?

  • How can I calculate the number of days in the current month?

  • I have a large list of html files, file_001 onwards, how can I make forward/back buttons in one frame that move through the files in another?

  • Is there a way I could force JavaScript to drop the decimal point in a fraction and make it a whole number?

  • How does a function know which object called it?

  • Is there a way to set the 'alt' property in an image object similar to the 'src' property?

  • How can I validate a form field so that leading zeros are dropped, any decimal places are dropped, any non numeric characters produce a warning, and if the resultant number is greater than 999 also produces a warning?

  • Is there any way to tell what resolution a user is using?

  • How can I stop popup windows being opened up by my web host provider?

  • How do I make a message on my status bar?

  • How do I make a scrolling message on my status bar?

  • How can I change the Width/Height of the current window (not maximized) with a link?

  • Can I embed my own font in a page?

  • Is there a way to make a link that when clicked will add the current page to the user's bookmarks or favourites, i.e. a link that simulates Ctrl+D?

  • Why must I set a timeout delay when submitting a form before closing the window - what is this delay accomplishing?

  • How do I delete an element from an array?

  • How do I validate a start date and an end date so that start is less than end, and that end is before todays date, using the date format dd/mm/yyyy?

  • How can I convert a text string: "Wed Aug 26 14:40:45 MET DST 1998." into a JavaScript date?

  • Is this a problem with how the MacOS gives up its date/time?

  • When creating a form, how can I check to see if data entered in a text field contains all numerics?

  • How do I make a link using JavaScript that mimics the action of the browser's BACK button?

  • How can I use the JavaScript replace method on a normal text link?

  • How can I determine if a checkbox on a form exists?

  • Is it possible using JavaScript to make buttons that scroll a frame up and down?

  • Is it possible to transfer an "option" item from dropdownlist A to dropdownlist B?

  • Is it possible to send an email from a link with text in the body of the email?

  • How can I avoid people bookmarking pages and returning later without logging onto my site?

  • When using location.replace(theURL) to replace the contents of a Frame within a frameset will the framesets onLoad event handler trigger?

  • How do I print the current web page whilst submitting a form?

  • How can I extract just the file name from a forms file upload field?

  • Why do you test for the image object instead of the replace method before using the replace method?

  • Can JavaScript code situated on the server write to a file on that server?

  • Why is JavaScript not a progamming language but a scripting language and what is a scripting language?

  • How can I prevent an external *.js file from being cached?

  • How can a form button be used to resize the existing frames?

  • Is there a way to accumulate a value in a textbox based on how many radio buttons are turned on?

  • Can arrays/objects be nested?

  • How do you change the text size and make it bold?

  • How can I dynamically add a ne option to a select list?

  • How can I store the current date in a hidden form field?

  • How do I alter the source of a layer?

  • How can I provide links to a cgi script for the date of the next seven days?

  • How can I make table rows disappear?

  • How can I force MSIE to open up and return the output of a cgi to a popup window using the onUnload() event handler?

  • How can I make a form which has three sections of radio buttons that will take the user to a specific page based upon their selections?

  • If I open a window and I give it a name, can I perform operations based on the name?

  • I need to know if there's anyway to get Netscape to let you dynamically resize your images through JavaScript?

  • How do I change the action property of a form based on which radio button is checked?

  • Using JavaScript - how can I detect when a page hasn't loaded within, say, 30 seconds?

  • How can I highlight normal text using onMouseover?

  • Is there a way to change to location of another frame to an anchor within that frame regardless of what document is loaded into that frame?

  • How can I count the time in seconds that a checkbox is really checked?

  • How do I let all my JavaScripts pre-load before they are executed?

  • How do I dynamicaly change the number of rows and columns in a textarea on form submit?

  • How can I show clocks, one showing the current time, and another showing a time 12 hours behind?

  • Can I create a window that stays on top, but does not interfere with the other items open on the desktop?

  • How can I open a window that calls up a cgi perl but without the name/value pairs being visible as part of the new windows ulr?

  • How can I refer to a dropdown select box that has a non alphanumeric name?

  • How do I check for the existence of a setTimeout() and remove it?

  • How do you reload a page in frame 2 from frame 1?

  • How can I read the contents of another frame?

  • How can I submit a form from a text link?

  • Is there a way to unconditionally direct the browser to an anchor tag?

  • Can I use JavaScript and cookies to allow a user to check a box next to their username to save it to their browser and check another box to save the password?

  • How can I create a three framed frameset in a new window and pass the text entered in a form as the parameters to a perl program to be displayed in one of the frames?

  • How can I direct the browser to a custom thank you page after the form is submitted?

  • How could I have JavaScript choose a random integer, say, between 0 and 25?

  • How can I vary the JavaScript *.js source file associated with the current page, but without loading the current page?

  • Is there any way to code password in a cookie so no one can read it?

  • How do I set focus to a text box when a checkbox is checked?

  • Is it possible to create a script that will refresh a page only when the mouse has been inactive?

  • How can I create a "slideshow" using html files (not images) whic move to the next page after five seconds?

  • Is there a way to save retain the values of global variables when the user resizes their web browser?

  • How can I covert a mm/dd/yy date to dd/mm/yy and vice versa?

  • What code do you need to swap images in tables?

  • How do you check if a date is valid or not?

  • How can I skip an IFRAME with a table when tabbing through the elements?

  • How can I use entities with Microsoft Internet Explorer?

  • Is it possible to openthe browser to a specific HTML frames document and dynamically specify the HTML document to be displayed in either frame?

  • Can I pass additional parameters as part of an event object to an event handler?

  • In MSIE how can I remove the border that appears around an image link when clicked?

  • How can I automatically calculate the date of the next meeting which is held on the second Thursday of each month?

  • How do I force the browser to reload a text file from the server when clickling a link to load it into another frame?

  • How do I know when to include the semi-colon (;) at the end of a line?

  • How can I resize a child when a new image is loaded into it?

  • How can I write into a nested Layer in Netscape?

  • How do I validate that a number entered in a text field is a hexidecimal number?

  • If a form has two submit buttons with the same name and different values, how can an onSubmit handler tell which button submitted the form?

  • How can I warn that a form submission is due after 25 minutes then submit after a further five minutes?

  • How can I have a dropdown form redirect to other pages, without a submit button?

  • How can a hypertext link pass data using the POST method, and not the GET method?

  • How can I make a pull down menu with email addresses?

  • How can I make a mouse over on an image without a link?

  • Can I create a beep?

  • How can I add two times together, 08:30 and 08:45 and get 17:15?

  • How do I force a reload of the main window whilst reloading the popup window on form submission?

  • How can I get an answer to a question to appear below after the question is clicked on?

  • How can I round a decimal number to a whole number (ie: 1.52=2)?

  • How can I change 2 (or more) images in another frame using onMouseOver over 2 (or more) different areas of text?

  • Are you sure you can't simulate charCodeAt() in browsers that don't support it?

  • Is is possible to trap the escape key and cause it to close the browser window?

  • Is there a way to open up a pop up window which will constrain to the dimensions of an image and still allow you to have a title text for the popup window?

  • How do I get the *.js files to not display their code in Netscape?

  • How can I scramble my JavaScript source code so that it is not easily copied?

  • How can I show 10 records from a database at a time?

  • How can I redirect several seconds after the document has completely loaded?

  • How can I display the results of a form in a new window opened with window.open()?

  • Can I create an 'on error resume next' in JavaScript?

  • How do you get JavaScript to check for events whilst in a loop?

  • Can I code around the dreaded 'Interface not supported' error message?

  • How can I make a thumbnail image selected show a full-size image in another table cell on the same page?

  • How can I display a javasript variable in my HTML page, is the answer &{JavaScript-statements};?

  • When using window.open for the second time on a already opened window, how can I bring the window in front of the main browser window?

  • WHow can I write to the status bar as the mouse moves over an image map so that viewers have a clearer idea of where clicking on that section of the image map will lead them?

  • When submitting a form, how do I get JavaScript to load a thank you page when the user presses the submit button?

  • A window has two pop-up windows, how can I close a pop-up window by clicking a link text in another pop-up window and load a different page in the main window at the same time?

  • Can you detect if JavaScript is enabled on the users browser?

  • How can I load someone elses page and then submit a form that tells me how long it took to load?

  • Is it possible to click on an image residing on a frame to make another frame go back or forward in the history list?

  • How can I clear the contents of another frame?

  • How can I make sure needed images are loaded before I do a redirect to another page?

  • How can you specify the size of a window with window.open() so that both NN & MSIE open a window with the same size document area?

  • How can I change the image and href property of another link when the mouse moves over another image?

  • How can you write to the document both the Last Modified and a review date, i.e. Last Modified date plus 100 days?

  • Can I add history backward and forward ability to an image map?

  • The lastModified doesn't appear to be Y2K compliant, for example a document amended with a date of 11th of June 2001 will show 01 as the year when using either getDate() or getFullDate(), is there a workaround?

  • How can I put the value of a selected select option into a textarea and retain the line breaks specified with \r\n?

  • How can I swap an image using onMouseOver in an image map?

  • Can I click some text next to a radio button to set the radio button to clicked?

  • How can I use different *.js files based on the browser being used?

  • How can I load a document into a new window from a link, if the browser supports JavaScript, and into the current window if it doesn't?

  • Is it possible to open up a new, small window using a text link instead of a button, also is it possible to have more than one per page?

  • Can I create a window, and on the fly write code to it to display a anmed image and a close button?

  • Is there a way of 'dynamically' changing the content of a normal text paragraph in a page on an event?

  • Is it possible to add options to an existing select list?

  • How can I swap an image out based on what someone selects from a select box?

  • How can change the location of two frames by clicking a text link?

  • How can I tell which link within the links[] object array was clicked on?

  • If JavaScript were a product, what would its specification be?

  • How can I pass a string value which is seperated by spaces using the locations search string?

  • How can I set the default value of a text box when a certain condition is true?

  • Is there any way to call multiple functions with a single event?

  • How do you get out of a loop once a certain condition is met?

  • How can I control the opening and closing of a popup window using a checkbox?

  • How can I open a popup window, or a new window if JavaScript is not enabled/supported?

  • Can JavaScript unselect selected text?

  • How can I close a pop up window containg frames?

  • Is there a way to do these two things : make a link to open a pop up window and specify that one of the two files contained in that pop up window must be open at the bookmark specified?

  • If I have an image object within <DIV> tags, how can I access the image without occuring JavaScript errors?

  • Is it possible to cause a multi-field form to be submitted when the user hits the enter key no matter which field on the form the cursor is in?

  • How do I iterate over all the opened windows?

  • Is JavaScript a Unicode aware language?

  • How can I prompt the user when they leave my page if they've amended a textarea withou submitting the form?

  • Is is possible to load an image into a popup window and then resize the window to fit the image, even if the window is already open?

  • How can I include today's date in the url of a link?

  • Where do I put my JavaScript code to make sure that it is executed only after the HTML page is completely loaded?

  • Is there a way to have a link submit a form, and then goto the new url?

  • How do I capture a character that is typed into a textarea and change it to another character?

  • How do you turn on/off JavaScript in IE4?

  • How can I pass the data entered in one form to another form in the same page?

  • How do I run a CGI script without returning anything?

  • Why can't I display text in the status bar when using onMouseOver?

  • How can I open a goodbye window, when a user selects link that leaves my site?

  • How can I show a description directly under an image map, using onMouseOver?

  • Why won't my popup window resize with window.resizeTo(400,400)?

  • How can I output half a page to one frame and the other half to another frame?

  • Is there any way to detect if a NN4 or higher user has disabled Style Sheets in users preferences setting?

  • How can I alter the contents of a layer in NN4 using JavaScript *.js source files to hold the text to be used in the layers?

  • How do I target differrent frames based on a URL value selected from a drop down list?

  • I have to run my code which uses JavaScript Date object on older browser versions, how do I cope with dates greater than 2000?

  • How can I change the contents of a table cell when the mouse moves over an image in a form?

  • What is the difference between plug-ins on Netscape Navigator and Active-X components on Microsoft Internet Explorer?

  • Where have all the JavaScript error messages gone in NN4.5?

  • Is it possible to randomise the selection of sound files to be played?

  • How can I refresh a webpage every 30 mins on the hour and the half-hour?

  • Can I have a mouse over in a client side image map change a different image on the same page?

  • How can I remove invalid characters from a form field before submission?

  • Is there a way to open a maximised window in MSIE?

  • How do I tell if a field exists on a form?

  • How can I open a "prompt" window and select it's size?

  • How do I make two dropdown menus, where the result of the selection of both dropdown menus will be shown in a text field?

    Javascript : The Definitive Guide 3rd Edition
    Available to buy!
    Read the Review!

    JavaScript FAQ Knowledge Base

    Search the JavaScript FAQ Knowledge Base:

    Example: frame form window

    Results will contain ALL the words entered in search field

    The JavaScript FAQ

    [VFAQ] [New] [All] [Cookie] [Date] [Event] [File] [Form] [Frame] [History] [Image] [Java] [Layer] [Link] [Number] [Object] [Password] [Mouse] [Random] [Scroll] [Status] [Sound] [*.js Source] [Timeout] [Text] [Table] [Window] [Bugs] [Not-A-Bug]

    Provide Feedback on the JavaScript FAQ Knowledge Base

    Ask A Question If your question is not answered in one of the FAQs, you can ask a question by completing the form.


    Last Updated: 9th February 1999 - Maintained by: Martin Webb
    Copyright © 1996-1999 irt.org, All Rights Reserved.
    irt.org liability, trademark, document use and software licensing rules apply.
    Your interactions with this site are in accordance with our public privacy statements.

    [Home] [What's New] [Articles] [FAQs] [Games] [BBS] [Reviews] [Downloads] [Find]