How can we submit a form without a submit button?
Answers were Sorted based on User's Feedback
Answer / prakash
In PHP, form can be submitted with simple code:
'header("location:page.php");'
| Is This Answer Correct ? | 18 Yes | 14 No |
Answer / shiva
what sinil wrote tats right but action must be included in
the <form action="" method=""> then it submit
| Is This Answer Correct ? | 90 Yes | 90 No |
Answer / 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 |
Answer / mani kumar
By using the javascript events on the html elements you can
submit the form values like,onblur(),onchange(),
onmouseup(), etc...
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / anoop singh
we can submit a form by using javascript submit function or
call a function on the click event of the button and
redirect it in to another page .
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / jeet
By the help of java script we can submit form with any options here i am using link, we can submit by checkbox, redio button etc..
<a href OnClick="javascript: document.myform.submit();" >Submit Me</a>
| Is This Answer Correct ? | 6 Yes | 8 No |
Answer / madhu
<script>
function formsubmit()
{
document.form.submit();
}
</script>
<form name="form" method="post">
<a href="#" onclick="formsubmit();">Submit</a>
</form>
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / viktor
Into HEAD section:
<script language="javascript" type="text/javascript">
function DoSubmit ()
{
document.myform.submit();
}
</script>
BODY section:
<body onload="document['myform'].submit()">
<form action="http://www.mysite.com/post.php" method="post"
name="myform" target="_self">
</form>
</body>
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / guest
The main idea behind this is to use Java script submit()
function in
order to submit the form without explicitly clicking any
submit button.
You can attach the document.formname.submit() method to onclick,
onchange events of different inputs and perform the form
submission. you
can even built a timer function where you can automatically
submit the
form after xx seconds once the loading is done (can be seen
in online
test sites).
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / snc
We can use a simple JavaScript code linked to an event
trigger of any form field. In the JavaScript code, we can
call the document.form.submit () function to submit
Example 1
<form method='post' action='some_action'>
<select name='something' onchange=‘this.form.submit () ;'>
<option value='1'>1</option>
<option value='2'>2</option>
</form>
Example 2
<form method='post' action='something'>
<input type='checkbox' name='something'
onclick=‘this.form.submit ()'>
</form>
| Is This Answer Correct ? | 4 Yes | 8 No |
Is string php function?
Can I include php in javascript?
Is age a variable in research?
What are the advantages of object-oriented programming in php?
What is the difference between associative array and indexed array?
How to upload any files extension in our database Ex.(.doc,.txt,mp4,mp3 etc.)in php
What is difference between variable declaration and variable definition?
How do I install php?
What is the difference between mysql_connect and mysql_pconnect ? Which one is good in terms of performance ?
What is the purpose of the php empty function?
How to add comments in php?
What is the difference between $var and $$var?