Page 1 of 1

AutoSubmit form recurring?

Posted: Wed Apr 09, 2008 9:36 pm
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>
?>
 

Re: AutoSubmit form recurring?

Posted: Thu Apr 10, 2008 1:33 pm
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!