DV-JF Posted December 18, 2015 Share Posted December 18, 2015 Hello, I'm trying to get FormTemplateProcessor work with the fieldtype "Select Options". The problem is that FormTemplateProcessor takes the name of the field and sends this information via email. $value = htmlentities($this->contact->get($field->name)); No problem for all other fields, but when it comes to the "Select Options Field" only the ID's were send via mail. Is there a way to send the title instead of the ID? I've got no ideas - some hints are welcome Many greets, Jens alias DV-JF. Link to comment Share on other sites More sharing options...
kixe Posted December 19, 2015 Share Posted December 19, 2015 (edited) You are using the wrong Api for Fieldtype Select Options. Read the docs:How to handle Fieldtype Select Options. Read the docs:https://processwire.com/api/modules/select-options-fieldtype/#outputting-selected-options-on-a-pageorhttps://processwire.com/talk/topic/11615-select-options-classes-based-on-selections $optionsfield // return id (string) $optionsfield->id; // return id (int) $optionsfield->title; // return string USE THIS or $optionsfield->value; // return empty string or value (if your option settings like '1=value|title') Edit: Sorry. Didn't read your post carefully. Form Template Processor is a very old module which doesn't take care about subfields or fields with multiple values. You have to make some changes to this module. Maybe the ProModule FormBuilder could be your solution.As a starting point to adapt Form Template Processor have a look at this topic:https://processwire.com/talk/topic/11733-how-to-get-subfields-or-properties-if-fieldtype-is-unknown-helpful-snippet/I am using a derivation of FormTemplateProcessor which creates Pages from the submitted stuff which works proper with any kind of fieldtype Edited December 20, 2015 by kixe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now