Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Javascript Navigation Redirecting URL in JavaScript Tutorial

Learn how to redirect to different web pages when the user selects an item from a drop-down menu.

Tutorial Details:

Code Beach - Redirecting URL in JavaScript

All .NET ASP BREW C++ C# ColdFusion Delphi/Kylix HTML J2ME Java JavaScript Palm Perl PHP Pocket PC Python SQL Ruby Symbian Visual Basic XML

Redirecting URL in JavaScript by: Amrit Hallan

Whenever you want to generate dynamic pages you often have to resort to using some server side scripting language such as PHP or ASP. But let us assume that there are only three or four pages that could be chosen from a drop-down menu (a combo-box). The following procedure helps you create a JavaScript-supported drop-down menu.

First the form:

< select name="pg_choice" onChange="javascript: take_there();">
< option value="no_page">Select a page to go to...
< option value="pg1.html">Page 1
< option value="pg2.html">Page 2
< option value="pg3.html">Page 3
< /select>
< /form>

This form presents to you three choices of pages. In its onChange attribute we decide what function to call to be re-directed to the respective page. And now the JavaScript:

Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.