WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : JavaScript dropdown list menu to switch any page.
Categories : Java Script, Beginner Guides, Form Processing Click here to Update Your Picture
Rupali Gulande
Date : Oct 10th 2007
Grade : 2 of 5 (graded 11 times)
Viewed : 29152
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Rupali Gulande
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Use a dropdown list menu to switch to any page. All we have to do is design a form and a drop-down list box for. The following piece of code will do it for you…

<form method="post">
<select name="url" onchange="switchpage(this)">
  <option value="http://www. weberdev.com">Weberdev</option>
  <option value="">Redirect to...</option>
  <option value="http://www.weberforums.com.com">WeberForums</option>
  <option value="http://www.php-code-search.com">PHP Code Seach</option>
</select>
</form>


The onchange event triggers the switchpage(this) function which gets called with the index of the drop-down list box. Now we define switchpage(this).

<language="javascript" type="text/javascript">
function switchpage(select) {
    var index;

  for(index=0; index<select.options.length; index++)
    if(select.options[index].selected)
      {
        if(select.options[index].value!="")
          window.location.href=select.options[index].value;
        break;
      }
}
</script>


Here as we select any option from drop-down list box we get redirect to url value of that option.



PHP and javascript mouseover, mouseout, and mousedown events
Categories : PHP, Java Script, Form Processing, Beginner Guides
Changing the Style of form objects using the JavaScript OnClick method.
Categories : Java Script, Form Processing, Beginner Guides, CSS
Show hide table rows to make dynamic forms
Categories : Beginner Guides, Java Script, Form Processing, HTTP
Form Processing : with alert Highlight field name which is not filled by user
Categories : Java Script, Form Processing, Data Validation, Beginner Guides, Web Design
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides
Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
Adding a Filter to a Text Element
Categories : Java Script, Data Validation, Form Processing
Upload any fixed type of files, control file type through javascript and encrypt filename using php so file not get overwrite
Categories : PHP, Java Script, Functions, PHP References, Form Processing
Balance values between two list boxes. Change the value of list box A acording to the value in list box B and vice versa using Javasvript.
Categories : Java Script, Form Processing
Local Time clock and Server time usign PHP and JavaScript
Categories : PHP, Java Script, Date Time, Beginner Guides
Simple PHP Form Field Generator
Categories : PHP, Beginner Guides, Form Processing, HTML and PHP
Store, retrieve and delete cookies using JavaScript.
Categories : Java Script, Cookies, Beginner Guides, Cookies
Get your browser details using javascript
Categories : Java Script, Beginner Guides, Browsers
Javascript URL and Email Validation
Categories : Java Script, Data Validation, Form Processing, Email, URLs
Validating a URL with JavaScript RegExp
Categories : Java Script, Data Validation, Beginner Guides