hi,
well, i let you have a look at eForm but, you can do what you’re looking for mixing a snippet for the php code and some chunks for the html
let’s have a look at a "simple" way to do this.
first, create your snippet to manage your data with
<?php
$myForm = ""; //this to initialize your coming form
if (!empty($_POST))
{
$toto = $_POST['toto']; //i let you do what you need, trim, addslahes and so on :)
//do the same for all your post vars
}
//then
$myVars['toto'] = isset($toto) ? $toto : "";
//the same for all the vars you would like to display into your form values
//then
$myForm.= $modx->parseChunk('myFormTpl', $myVars, '[+', '+]'); //this will use your myForm chunk
//and, in the end
return $myForm; //important to return something :)
?>
now just create a chunk you’ll call myFormTpl using your params as placeholders, e.g
<form id="ziForm" method="post" action="the page you want">
<input type="text" name="toto" id="toto" value="[+toto+]" />
</form>
and here you are
of course, you can condition the use of a thanks template to the success of your form treatment, there are no virtual limits to that kind of use of snippets and chunks for what i’ve seen so far.
Have swing