Hi,
field names are generated dynamically
That's interesting. Can I take a look at the form to understand why?
One technique that works well, but is quite complicated, is to use the dynamic form itself (presumably in PHP) to generate its own template. I do this quite a bit for customers.
So, the logic is a bit like this:
PHP Code:
<?php
$sNextQty = GenerateFieldName();
if ($_GET["template"])
{
//
// this is the template generation. it uses the advanced templates
// <if> feature to skip the field if it wasn't entered
//
?>
<if $<?php echo $sNextQty; ?>>
The quantity is $<?php echo $sNextQty; ?>
</if>
<?php
}
else
{
//
// this is the form generation.
//
?>
Please enter your quantity: <input type="text" name="<?php
echo $sNextQty; ?>" />
<?php
}
?>
<!--
Now tell FormMail to use this form for the template.
-->
<input type="hidden" name="mail_options" value="HTMLTemplate=thisform.php?template=1" ?>
You need to set $TEMPLATEURL, not $TEMPLATEDIR, and set it to your basic URL.
It saves you from having to create a template manually, but makes your form PHP a little more complicated.
Bookmarks