Metachecker.net
|
FontsMadeEasy.com
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Navigation By Radio Button
[View Sample]
The destination file title, a description, and URL appear in a text area when a radio button is choosen
Insert into <HEAD>
Insert into <BODY>
<script language="JavaScript"> <!-- Activate Cloaking Device var recnum=""; // Used to initialize arrays. function initArray() { this.length = initArray.arguments.length; for (var i = 0; i < this.length; i++) { this[i] = initArray.arguments[i]; } } // Creating arrays. var rcrd = new initArray(); var address = new initArray(); rcrd[1] = "Home Page\r\nThe home page of this site."; address[1] = "index3.htm"; rcrd[2] = "Contents\r\nA listing of the contents of this site."; address[2] = "contents.htm"; rcrd[3] = "Navigation Aids\r\nExamples of various ways to make navigation of your site easier."; address[3] = "navigationaids.htm"; rcrd[4] = "A Dropdown List\r\nAn example of a dropdown list for site navigation."; address[4] = "dropdown.htm"; // Called by onClick for each radio button - determines & displays message and URL. function dataBase(leapto) { for (var i = 0; i < 4; i++) { if (leapto.buttons[i].checked) { recnum = leapto.buttons[i].value; } } if ( (rcrd[recnum] != null) && (rcrd[recnum] != "") ) { document.leapto.display.value = rcrd[recnum]+"\r\n\r\n"+address[recnum]; } } // Called by Lets Go button - loads pre-selected page. function leapTo() { if ( (address[recnum] != null) && (address[recnum] != "") && (recnum != "") ) window.location= address[recnum]; else alert("\nYou must first select a radio button."); } // Deactivate Cloaking --> </script> </head> <body bgcolor="#ffe4c4" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> <center><h1>Navigation by Radio Buttons 3</h1></center> <p>Here's another variation of the script. This time the destination file title, a description, and URL appear in a text area when a radio button is chosen.</p> <center><form name="leapto"> <table border=3><tr> <td align="center" bgcolor=000080> <input type="radio" name="buttons" value="1" onclick="dataBase(this.form)"> <font color=00ffff><b>Home Page</b></font></td> <td align="center" bgcolor=ff0000> <input type="radio" name="buttons" value="2" onclick="dataBase(this.form)"> <font color=000000><b>Contents</b></font></td> <td align="center" bgcolor=c0c0c0> <input type="radio" name="buttons" value="3" onclick="dataBase(this.form)"> <font color=800000><b>Navigation Aids</b></font></td> <td align="center" bgcolor=008080> <input type="radio" name="buttons" value="4" onclick="dataBase(this.form)"> <font color=ffff00><b>A Dropdown List</b></font></td></tr> </table> <br><br> <table border=0><tr> <td align="center" width=350> <textarea name="display" rows=6 cols=25 wrap=yes></textarea></td> <td align="center" width=150> <input type="button" value="Let's Go!" onclick="leapTo()"></td></tr> </table> </form> </center>
Other Options