How can we submit a form without a submit button?

Answer Posted / himanshu

function nav()
{
var w = document.myform.mylist.selectedIndex;
var url_add = document.myform.mylist.options[w].value;
window.location.href = url_add;
}


// This code is placed in the HTML body
<FORM NAME="myform">
Jump to:
<SELECT NAME="mylist" onChange="nav()">
<OPTION VALUE="../../index.html">Home Page
<OPTION VALUE="../../basics/index.php3">Basics
<OPTION VALUE="../../tutorials/index.php3">Tutorials
<OPTION VALUE="../../templates/index.php3">Web Design Templates
<OPTION VALUE="../../graphics/index.php3">Web Graphics Design
<OPTION VALUE="../index.php3">Tips and Tricks
<OPTION VALUE="../../design/index.php3">Web Page Design
<OPTION VALUE="../../services/index.php3">Services
</SELECT>
</FORM

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does firefox manage cookies?

749


What is properties of class?

780


Explain mysql_errno()?

734


What are constructor and destructor in PHP?

751


How can you pass a variable by reference?

730


How big is nvarchar max?

760


How do I know my xampp version?

708


What is php key?

684


How do I display php errors?

687


What is php form validation?

737


Explain how is it possible to set an infinite execution time for php script?

697


Is php pass by reference or value?

739


What is the function mysql_pconnect() useful for?

715


Explain briefly about a search-friendly site looks like?

677


What is the output of the following php code?

650