...

View Full Version : IF statement auto submit



CPD
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'];
formObject.submit();
}
</script>



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



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

?>


But it wont work for me
any Ideas ??

Fou-Lu
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.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum