[[+osType:is=`linux`:then=`whatever html or text you want to use`]] [[+osType:is=`windows`:then=`whatever html or text you want to use`]] [[+osType:is=`macos`:then=`whatever html or text you want to use`]] [[+osType:is=`novatel`:then=`whatever html or text you want to use`]]
You can just use output filters in your fiarTpl using build-in hook FormItAutoResponder to generate response text based on selected option.
For example when you use the fieldname osType in your form it would be:
[[+osType:is=`linux`:then=`whatever html or text you want to use`]] [[+osType:is=`windows`:then=`whatever html or text you want to use`]] [[+osType:is=`macos`:then=`whatever html or text you want to use`]] [[+osType:is=`novatel`:then=`whatever html or text you want to use`]]
the osType in example should be the exact value in your html form. You can even create seperate custom chunks for each os and call them instead of full html or text in then-clause.
Hi DonQuicky,
My html formit code looks like this
<select name="OS" class="menuList">
<option>Select Operating System</option>
<option value="Windows" [[!+fi.os:formitisselected="`Windows`]]">Windows</option>
<option value="MacOS" [[!+fi.os:formitisselected="`MacOS`]]">Mac OS</option>
<option value="Linux" [[!+fi.os:formitisselected="`Linux`]]">Linux</option>
<option value="Novel" [[!+fi.os:formitisselected="`Novel`]]">Novel</option>
</select>
So where should I add your suggestions.
Thank you
Pronab
Quote from: donquicky at Jul 22, 2013, 08:16 AMYou can just use output filters in your fiarTpl using build-in hook FormItAutoResponder to generate response text based on selected option.
For example when you use the fieldname osType in your form it would be:
[[+osType:is=`linux`:then=`whatever html or text you want to use`]] [[+osType:is=`windows`:then=`whatever html or text you want to use`]] [[+osType:is=`macos`:then=`whatever html or text you want to use`]] [[+osType:is=`novatel`:then=`whatever html or text you want to use`]]
the osType in example should be the exact value in your html form. You can even create seperate custom chunks for each os and call them instead of full html or text in then-clause.
[[+osType:is=`linux`:then=`[[$tplLinux`]] [[+osType:is=`windows`:then=`[[$tplWindows`]] [[+osType:is=`macos`:then=`[[$tplMacOS]]`]] [[+osType:is=`novatel`:then=`[[$tplNovatel`]]
&fiarTpl=`tplSelectOS`
[[!FormIt? &hooks=`recaptcha,spam,FormSave,email,redirect,FormItAutoResponder` &emailTpl=`trial_report` &emailSubject=`Trial Form - [[+name]]` &emailTo=`[email protected]` &redirectTo=`91` &fsFormTopic=`contact` &recaptchaTheme=`white` &fiarTpl=`tplSelectOS` &fiarSubject=`Thank You for Contacting Us` &fiarToField=`email` &fiarFromName=`Learn MODx Website` ]]
[[+osType:is=`linux`:then=`[[$tplLinux`]] [[+osType:is=`windows`:then=`[[$tplWindows`]] [[+osType:is=`macos`:then=`[[$tplMacOS]]`]] [[+osType:is=`novatel`:then=`[[$tplNovatel`]]
Let's assume you will use separate templates [chunks] for each OS and let's assume these will be tplLinux, tplWindows, tplMacOS and tplNovatel. You have to create 4 chunks named as mentioned and put your html for the email template in it.
Create a seperate chunk for the template call for &fiarTpl en put the next code in it:
[[+osType:is=`linux`:then=`[[$tplLinux`]] [[+osType:is=`windows`:then=`[[$tplWindows`]] [[+osType:is=`macos`:then=`[[$tplMacOS]]`]] [[+osType:is=`novatel`:then=`[[$tplNovatel`]]
Call it for example tplSelectOS so the call in FormIt would be
&fiarTpl=`tplSelectOS`
Ah, I see some missing characters:
[[+osType:is=`linux`:then=`[[$tplLinux]]`]]
[[+osType:is=`windows`:then=`[[$tplWindows]]`]]
[[+osType:is=`macos`:then=`[[$tplMacOS]]`]]
[[+osType:is=`novatel`:then=`[[$tplNovatel]]`]]
In your case it should be +OS
Yep, osType was an exampleIn your case it should be +OS
[[+OS:is=`Linux`:then=`[[$tplLinux]]`]] [[+OS:is=`Windows`:then=`[[$tplWindows]]`]] [[+OS:is=`MacOS`:then=`[[$tplMacOS]]`]] [[+OS:is=`Novatel`:then=`[[$tplNovatel]]`]]