How can we submit a form without a submit button?

Answers were Sorted based on User's Feedback



How can we submit a form without a submit button?..

Answer / prakash

In PHP, form can be submitted with simple code:
'header("location:page.php");'

Is This Answer Correct ?    18 Yes 14 No

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

How can we submit a form without a submit button?..

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

Post New Answer

More PHP Interview Questions

What are the delimiters in php?

0 Answers  


How to replace a text in a string with another text in php?

0 Answers  


Which function is used in php to count the total number of rows returned by any query?

0 Answers  


What is the difference between query and inquiry?

0 Answers  


what is this error "Call to unsupported or undefined function mysql_connect();" and when you will get this?

2 Answers  


How to implement a class named dragonball. This class must have an attribute named ballcount (which starts from 0) and a method ifoundaball. When ifoundaball is called, ballcount is increased by one. If the value of ballcount is equal to seven, then the message you can ask your wish is printed, and ballcount is reset to 0. How would you implement this class?

0 Answers  


Explain briefly about a search-friendly site looks like?

0 Answers  


Explain me what is the meaning of a persistent cookie?

0 Answers  


Is jquery better than javascript?

0 Answers  


What do you use php for?

0 Answers  


Do I need apache for php?

0 Answers  


What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?

7 Answers   HCL,


Categories