• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 496
  • Last Modified:

the auto submit javascript is not working in firefox!

Hello i have this javascript code that autosubmit a form however it didn't work in firefox how to fix or replace with a code that work on all internet surfer.
<script type="text/javascript">
                        document.payform.submit();
                  </script>
0
Audiominds
Asked:
Audiominds
  • 2
1 Solution
 
pessanhaCommented:
Try something like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> Test Submit() at Firefox </TITLE>
   <script type="text/javascript">
     function Go() {
       document.payform.submit();
     }
   </script>
 </HEAD>
 <BODY>
 <form action='teste2.html' method='post' name='payform'>
 <input name='nome' value='nome' onClick='Go()'></input>
 </form>
 </BODY>
</HTML>
0
 
AudiomindsAuthor Commented:
but this need the user to click in the input ! i need something that auto submit as soon as the page load !
0
 
pessanhaCommented:
I imagine that´s is more simple. Use the event onLoad (vide sample below):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> Test Submit() at Firefox </TITLE>
   <script type="text/javascript">
     function Go() { document.payform.submit(); }
   </script>
 </HEAD>
 <BODY onLoad='Go();'>
 <form action='teste2.html' method='post' name='payform'>
 <input type='hidden' name='nome' value='nome'></input>
 </form>
 </BODY>
</HTML>
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now