fiarTpl is for the auto responder; which is used to send the form info to additional email addresses.
fiarTpl should contain a reference to a chunk TPL.
This doesn't sound like what you're trying to do.
It sounds like you're trying to send this data from the product page to the form to be filled in; You should append a query string to the URL and then write that data into the form via JS.
This example passes the path to the page linked from, and also the ID of the page with the link; here resource 1 should be your form page:
<a href="href="[[~1]]?key=/[[~[[*id]]]]&key2=exampleprefix-[[*id]]">Form Link</a>
Which comes out when you land on the form page as:
website.com/form?key1=/RESULT&key2=exampleprefix-RESULT
Parse these values via JS.
var queries = window.location.search;
function QS(key) {
try {
// snips the ?
var query = queries.substring(1);
// split to array
var vars = query.split("&");
// loop all items in array
for ( var i = 0; i < vars.length; i++ ) {
// split item in array into key value pair
var pair = vars[i].split("=");
// if this item key = the key passed in - return the value
if ( pair[0] == key ){
// if a value is blank, abort loading now
// indicates an error, or a bad spoof
if ( pair[1].length == 0 ){
throw "ERROR: QUERY BLANK";
}
// return value of passed key
return pair[1];
}
}
// if no match is found, throw an error
throw "ERROR: QUERY NOT FOUND";
}
catch(er) {
// switch the error bool to true
errorLoading = true;
// return error string instead of expected string
return er;
}
}
Then pull values like so:
var someKeyToFind = QS("key2");
Which should result in the referral page's ID.
If you're passing strings - eg the product page's title, which you can write into the form page - you'll also want to replace specials, which you can do quick and dirty like so (add the rest you need):
QS("key2").split('%20').join(' ').split('%27').join("'");
Now you will be able to get things like a product ID etc from a clicked link, and then select or write in the appropriate form fields.
Writing them in with jQuery can be done via .val(); You can also select dropdown items, or just edit things like a product title. Don't forget to write things into form values if you want formit to send them on into the TPLs.
As I said before, this is not secure in any way, but it allows you to pass options to a form with no effort.
[ed. note: johnnyp last edited this post 11 years, 3 months ago.]