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

How to initiate a session in php?

0 Answers  


Explain the difference between $var and $$var?

0 Answers  


Does apache use php?

0 Answers  


How can I use single quotes in single quotes in php?

0 Answers  


Is session a cookie?

0 Answers  






What are php magic methods?

0 Answers  


What is ci framework in php?

0 Answers  


What's the diff. between include() and Include_once().

5 Answers   Intrack,


Which function(s) in PHP computes the difference of arrays?

0 Answers  


Do you know what is use of count() function in php?

0 Answers  


What are php errors?

0 Answers  


How to select a database?

0 Answers  


Categories