Form Submit

Can you submit a form without using submit button? If Yes, How?

Questions by arup Kr. Porel

Showing Answers 1 - 39 of 39 Answers

vyshastar

  • Dec 3rd, 2008
 

If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link.
Eg:
<a href="javascript: document.myform.submit();">Submit Me </a>

If you want to use javascript to submit following answers are good but it you want to submit for without using javascript just use
<input type="image" src="{image-path}" >  this will work same as submit button.

  Was this answer useful?  Yes

kedarPhp

  • Sep 2nd, 2010
 

add the following code at your page where you have form named as frmdemo.

<script>
function submitForm()
{
document.frmdemo.action=backpage.php;document.frmdemo.submit();
}
</script>
<a href="javascript:submitForm();" >Click here to submit the page</a>

  Was this answer useful?  Yes

ram kumar

  • Nov 17th, 2011
 

Yes we can submit without submit button using java script or one more thing is make a location header.. like....


Code
  1. Header("Location: $a");

  Was this answer useful?  Yes

Arun

  • Jan 29th, 2015
 

I know its a bit late to answer but the above answers may mislead freshers. Ram redirection is not form submit, to submit a form without submit button, we may use java script.

eg: ;

Code
  1.  document.getElementById(form id).submit()

  2. <form id="form1" action="#page to submit form data">

  3. // form contents

  4. </form>

  5.  

  6. <script type="text/javascript">

  7.   document.getElementById(form1).submit();

  8. </script>

aditya dhanraj

  • Apr 29th, 2015
 

Yes,by using submit() function of java script

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions