Hi everyone!
I am trying to set up a simple order form using formIt and getResources. Basically, I have a bunch of 'product' resources, where I add an image, a price, a title etc. The end goal is to display each product within a form, with an input for quantity. So people can bulk order; enter how many of each product they want, and have that sent in an email.
The product resources are rendered inside a formIt form with getResources. The getResources template has an input for quantity that I need to somehow pass along as a formIt tag to display in the formIt email template.
Here is my getResources template:
<tr>
<td class="product-image">
[[+tv.product-image]]
</td>
<td class="product-title">
[[+pagetitle]]
</td>
<td class="product-price">
[[+tv.product-price]]
</td>
<td class="product-quantity">
QTY: <input placeholder="0" name="" min="0" type="number" value="" />
</td>
</tr>
And here is my form:
[[!FormIt?
&hooks=`email`
&emailTpl=`orderFormTpl`
&emailTo=`[email protected]`
]]
<form action="[[~[[*id]]]]" method="post">
<table>
[[!getResources?
&parents=`6`
&tpl=`productTpl`
&includeTVs=`1`
&processTVs=`1`
&sortby=`menuindex`
&sortdir=`ASC`
&limit=`0`
]]
</table>
<input class="btn" type="submit" value="Submit" />
</form>
As far as I can tell, an input needs to have the name match the value in order for it to render in the email. So if
then value would need to be
But I am at a loss as to how to have the name be pagetitle, and value be pagetitle + user input for quantity, and have that info passed along to the formIt email template.
So can formIt take this info from dynamically generated inputs and render it in the email? I am leaning towards this not being possible. But I have learned not to underestimate the knowledge of this community!
Any advice would be greatly appreciated.
Thanks!