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 |
I just installed php 5.3.1 in my linux server and now my old work which i used to write with tags is not working at all.. Please help me out.. How can i resolve this??
Can we override static method in php?
How is php different from other languages?
How to declare an array in php?
What is static variable in php?
What are computer variables?
Is apache needed for php?
Does exist in php?
How do you check is php not empty?
Write a regular expression to get the value xxx from the string 'xxx@yyy.com'
Explain mail function in PHP with syntax?
How to create an empty array in php?