AutoSubmit form recurring?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
coolin
Forum Newbie
Posts: 21
Joined: Sun Mar 16, 2008 1:44 pm

AutoSubmit form recurring?

Post by coolin »

Hi By adding the Javascript function below I've managed to get a form which is a part of a large pre-written application to submit automatically when loading page but it seems to just repeat this every second going into some kind of loop. Any ideas how this might be caused/cured would be much appreciated
(The form is for payment choices with one option already checked, being all that seems neccessary when manually submitting the form)

Code: Select all

 
<?php
<form name=\"transa\" action=\"";
          if($this->db->get_site_setting
             ('use_ssl_in_sell_process'))
            {
              $this->body .= $this->db->get_site_setting                   ('classifieds_ssl_url');
            }
          else
            {
               $this->body .= $this->db-
 
>get_site_setting('classifieds_file_name');
            }
            $this-
 >body .="?a=1&b=billing_accepted&set_trans_details=1\" method=\"post\">
 
<script language=\"Javascript\">
           function submitForm()
           {
           document.transa.submit();
            }
</script>
 
<body onLoad=\"submitForm();\">
</body>
?>
 
coolin
Forum Newbie
Posts: 21
Joined: Sun Mar 16, 2008 1:44 pm

Re: AutoSubmit form recurring?

Post by coolin »

Having got a bit of further help on this I can leave note with the answer which was in a name: original code was

Code: Select all

 
<php   
                   <input type=\"submit\" name=\"z\" 
                    value=\"".urldecode($this->messages[219])."\"
                         
                    class=\"save_choices_button\" />
?>        
 
 
 
 
All I had to do was change submit to hidden so that the intended values were forwarded (in the right format) to the form when submitting Thanks for reading
CASE SOLVED!
Post Reply