We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44437
    • 74 Posts
    Hey guys, I have a snippet that I want to display the different SuccessMessage based on the result calculated in the snippet. I looked at the Formit API Documentation, however, I'm getting a timeout error with the code below. How do I set the SuccessMessage in a snippet?

    [[!Formit?
      &hooks=`mySnippet`
    ]]
    


    //mySnippet
    $result = cal($uservalue);
    if ($result==1){
    $hook->setSuccessMessage('passed');
    return true;
    }
    elseif ($result==2){
    $hook->setSuccessMessage('failed');
    return true;
    }
    else {
    $hook->setSuccessMessage('there is a problem');
    return true;
    }
    

    This question has been answered by random_noob. See the first response.

    • discuss.answer
      • 44437
      • 74 Posts
      I have found alternative using this guide http://forums.modx.com/index.php?action=thread&thread=54590&i=1