I have this working, sorta, but I’m stuck in one of those designer situations that forces me against my will to not have labels on the forms but use the form fields themselves as a label. I know, it’s insane . . . . I’m hoping they’ll see how stupid this is in testing (I have <label>’s, they are hidden.) This also interferes with any error messages used in the form fields.
For whatever reason I cannot get the prehooks to work. Shortened, snippet loadInitialValues, pretty much from the manual,
<?php
$scriptProperties[’preHooks’]->fields[’fname’] = ’Your First Name’;
$scriptProperties[’preHooks’]->fields[’email’] = ’Your Email Address’;
return true;
?>
(I have tried both preHook and preHooks)
and the variations I’ve tried,
[[!FormIt? &preHooks=`loadInitialValues` &hooks=`email,redirect` &emailSubject=`Visitor Inquiry from Your Site` &emailTpl=`smallFormReport` &emailTo=`
[email protected]` &redirectTo=`43`]]
[[!FormIt? &hooks=`loadInitialValues,email,redirect` &emailSubject=`Visitor Inquiry from Your Site` &emailTpl=`smallFormReport` &emailTo=`
[email protected]` &redirectTo=`43`]]
Even with the prehook by itself.
[[!FormIt? &preHooks=`loadInitialValues`]]
[[!FormIt? &hooks=`loadInitialValues`]]
Typical field,
<p><label for="emailaddr">Email Address:</label><span class="required">*</span> <input class="txt" type="text" id="emailaddr" name="emailaddr:email:required:stripTags" size="35" value=""></p>
or with a value in it . . . doesn’t seem to do anything.
I also can’t get the error message to display on intentional input errors, such as "sdsadfs" for the previous field. It’s identical to the sample in the manual:
<p>[[+fi.error.error_message]]</p>
and appears to "work" as its bouncing back to the form, it’s just the error message is null.