[[!FormIt? &hooks=`spam,email,redirect` &emailTpl=`advertiseEmail` &emailSubject=`Advertising Inquiry` &emailTo=`[email protected]` &store=`1` &redirectTo=`50` &submitVar=`adSubmit` &validate=`first:required, last:required, print:required, online:required, both:required` ]] [[!+fi.error_message:notempty=`<p class="error">[[!+fi.error_message]]</p>`]] <form action="[[~[[*id]]]]" method="post" id="advertiseForm"> <input type="hidden" name="nospam:blank" value="" /> <fieldset> <label class="floatLt" for="first"> First:<br /> <span class="error">[[!+fi.error.first]]</span> </label> <input type="text" name="first" id="first" value="[[!+fi.first]]" class="" /> <label class="floatLt" for="last"> Last:<br /> <span class="error">[[!+fi.error.last]]</span> </label> <input type="text" name="last" id="last" value="[[!+fi.last]]" /> </fieldset> <fieldset> <label class="floatLt" for="advertising"> Form of Advertising:<br /> <span class="error">[[!+fi.error.advertising]]</span> </label> <input type="hidden" name="advertising[]" value="" /> <input type="radio" name="advertising[]" id="print" value="[[!+fi.print]]" [[!+fi.color:FormItIsChecked=`blue`]] > Print <input type="radio" name="advertising[]" id="online" value="[[!+fi.online]]" [[!+fi.color:FormItIsChecked=`red`]] > Online <input type="radio" name="advertising[]" id="both" value="[[!+fi.both]]" [[!+fi.color:FormItIsChecked=`green`]] > Both </fieldset> <fieldset> <label class="floatLt" for="comments"> Comments/Questions: </label> <textarea cols="30" rows="6" class="floatLt"></textarea> </fieldset> <input type="submit" name="adSubmit" value="Send" id="adSubmit" class="submitButton bttn" /> </form>
<input type="radio" name="advertising[]" id="print" value="Print" [[!+fi.advertising:FormItIsChecked=`print`]]> Print <input type="radio" name="advertising[]" id="online" value="Online" [[!+fi.advertising:FormItIsChecked=`online`]]> Online <input type="radio" name="advertising[]" id="both" value="Both" [[!+fi.advertising:FormItIsChecked=`both`]]> Both
&validate=`first:required, last:required, advertising:required`
<input type="radio" name="advertising" id="print" value="print" [[!+fi.advertising:FormItIsChecked=`print`]]> Print <input type="radio" name="advertising" id="online" value="online" [[!+fi.advertising:FormItIsChecked=`online`]]> Online <input type="radio" name="advertising" id="both" value="both" [[!+fi.advertising:FormItIsChecked=`both`]]> Both
@Bruno if this is true then we need to get the docs updated because they recommend an array.
FormIt Handling Selects and Radios
@todd.b can you post back if it works or not so I can let ScottBorys know so he can update the docs this friday.
Thanks.
[[!FormIt? &hooks=`spam,email,redirect` &emailTpl=`advertiseEmail` &emailSubject=`Advertising Inquiry` &emailTo=`[email protected]` &store=`1` &redirectTo=`50` &submitVar=`adSubmit` &validate=`first:required, last:required, advertising:required` ]] [[!+fi.error_message:notempty=`<p class="error">[[!+fi.error_message]]</p>`]] <fieldset> <label for="advertising"> Form of Advertising: <span class="error">[[!+fi.error.advertising]]</span> </label> <input type="radio" name="advertising[]" id="print" value="Print" [[!+fi.advertising:FormItIsChecked=`print`]]> Print <input type="radio" name="advertising[]" id="online" value="Online" [[!+fi.advertising:FormItIsChecked=`online`]]> Online <input type="radio" name="advertising[]" id="both" value="Both" [[!+fi.advertising:FormItIsChecked=`both`]]> Both </fieldset>
[[+comments]]
<fieldset> <label for="comments"> Comments/Questions: </label> <textarea cols="30" rows="6" name="comments" id="comments" value="[[!+fi.comments]]" > </fieldset>