|
|
|
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 | |
|
|