The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
submission pre-parser, what's wrong with this code

Pretty straight forward, I would've thought, but not working.

$submission_info = ft_get_submission_info(1, 1);
if (($_POST["Status"]=="Active") && ($submission_info["status"]=="Inactive"))

  $_POST["Transitions"]= "String";

Basically, on a transition from "inactive" to "active" change the text in the "Transition" form field name (it's a text box).

The condition executes, but I have no clue what's wrong with the POST thing. PHP beginner here

Second thing, how do I obtain the current submission ID, rather than using ft_get_submission_info(1, 1), I would like to use something like ft_get_submission_info(1, $Submission_ID)?
OK, so doing an echo $_POST["Transitions"]; after the if statement shows that the $_POST value changes, but I still have no clue as to why it's not changing in the form field itself

Any ideas?
So I've forsaken working with submission_preparser and added the following code to the hooks manager on the ft_update_submission, start

global $g_table_prefix;
$form_id = 1;
$submission_info = ft_get_submission_info($form_id, $submission_id);
if (($_POST["Status"]=="Active") && ($submission_info["status"]=="Inactive"))
  $result =  mysql_query("UPDATE {$g_table_prefix}form_{$form_id} SET transitions = 1 WHERE submission_id = $submission_id");
  echo $result;

$result returns 1, and still the database doesn't update when I check from phpmyadmin or from the form tools fontend


Forum Jump:

Users browsing this thread: 1 Guest(s)