View Full Version : IF statement auto submit

08-03-2012, 09:34 PM
Hello All
I need to frequently do an auto submit after an sql query to advance to the next stage of the form

Here is a simplified piece of code as an example of what I am trying to do
This is the Javascript which works fine for the sections where I use onclick="autoSubmit();"

<script language="JavaScript">

function autoSubmit()
var formObject = document.forms['theForm'];

And this is the PHP which after a $var is set I need an auto submit

if($var != null )
{ autoSubmit(); }


But it wont work for me
any Ideas ??

08-03-2012, 10:10 PM
Have you defined autoSubmit in the PHP code anywhere? PHP and Javascript are not capable of communicating directly as PHP is processed prior to sending data to the client.

08-03-2012, 10:40 PM
<script type="text/javascript">