Jump to content

Recommended Posts

Posted

the FormTemplateProcessor module generally works well for what I need it for, but when it comes to FieldTypeOptions, fields, the index is what shows up when emailing a form.

I've tried the following, but it doesn't fix it:

 

                        if($field->type instanceof FieldtypeOptions){
                            $value = htmlentities($this->contact->get($field->name)->title);
                        }else{
                            $value = htmlentities($this->contact->get($field->name));
                        }

In documentation for 

FieldTypeOptions is says that it's possible to assign a value like this: 1=value|label

Even if I do, I don't seem to be able to get the value to display, and only the index number is returned in the email whether I use

$this->contact->get($field->name)->title or $this->contact->get($field->name)->value 

Where am I going wrong?

  • 4 months later...
Posted

Hi Kiwi Chris. Did you ever solve this? I've got the same problem and have tried similar things with no luck. Any enlightenment would be useful.

thanks.

Posted

UPDATE: I just tried Kiwi Chris's code and it worked fine for me. I had previously used

$this->contact->get($field->name->title)

instead of this

$this->contact->get($field->name)->title

which worked.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...