Hi TobyL, thanks for explanation
I try to add your code, but it doesn’t seem to work.
Here is the snippet (valueMail) I created :
<?php
//Paste in a new snippet and include this on the same page before the eform call
function valueMail( &$fields, &$templates ){
global $modx;
//only if form is not posted...
$postback = ( count($_POST)>0 && $fields['formid'] == $modx->event->params['formid'] )? true:false;
if(!$postback) $fields['email'] = "Votre e-mail";
return true;
}
?>
Then, I call it before eForm :
[!valueMail!]
[!eForm? &formid=`form` &tpl=`tplNewsletter` &eFormOnBeforeFormMerge =`valueMail` ... !]
And here is the template tplNewsletter :
[+validationmessage+]
<h2><span>Newsletter</span></h2>
<form method="post" action="[~[*id*]~]">
<div><input type="hidden" name="formid" value="form" /></div>
<label for="form-email">e-mail</label>
<input id="form-email" type="text" name="email" maxlength="255" size="19" eform="e-mail:email:1" />
<input src="assets/css/submit-newsletter.jpg" type="image" name="submit" value="Entrez" id="saveForm" />
</form>
I tried to comment
$postback = ( count($_POST)>0 && $fields['formid'] == $modx->event->params['formid'] )? true:false;
if(!$postback)
to see if the problem comes from the if part : no, it doesn’t... without $postback, value isn’t displayed
I tried &eFormOnBeforeFormMerge and &OnBeforeFormMerge (I use 1.4.4.5) : no difference
I tried to call the snippet valueMail cached and uncached : no difference
I cleaned the cache : no way...
I don’t know what to test
Note that I already run a eform2db snippet but I removed it from my call to run these tests
Thanks for your help