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
PHP Web Logs (BLogs)
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
Submit Site
Forex Trading Online forex trading platform

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 : 3 of 5 (graded 6 times)
Viewed : 10231
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.



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
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
Adding a Filter to a Text Element
Categories : Java Script, Data Validation, Form Processing
Db_lib - practical example usage of database abstraction and form validation.
Categories : PHP, Form Processing, PHP Classes, Data Validation, Beginner Guides
Validating a URL with JavaScript RegExp
Categories : Java Script, Data Validation, Beginner Guides
Easy alert box pop-up function
Categories : PHP, Java Script, Beginner Guides
Ajax - Perform a simple server side request and update the current HTML page.
Categories : AJAX, Java Script, Beginner Guides
Simple PHP Form Field Generator
Categories : PHP, Beginner Guides, Form Processing, HTML and PHP
Form Validation Using PHP to highlight non valid fields
Categories : PHP, Form Processing, Data Validation, Beginner Guides
Form validations using javascript and including all validations in one message
Categories : HTML and PHP, Java Script, Form Processing
Local Time clock and Server time usign PHP and JavaScript
Categories : PHP, Java Script, Date Time, Beginner Guides
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