Hello again,
In converting one of my CF5 forms to CF6, I'm trying to recreate an event switcher. I saw in the demo that you have for the Data Source: {data:product}. However, in the past, we were about to use code directly in the event switcher to customize our condition. For example, if I wanted to compare a field value to a GET param, I had done something like this:
I see in the instructions this:
{function:FUNCTION_NAME} or {fn:FUNCTION_NAME}
Run a function, function must be created under the Events tab.
Would I need to use a custom code (php) action before my event switcher, or do I need to go back to my designer and add something to the events tab?
As an aside, if I need to set up an event on a field for my switch condition to operate off of, that becomes difficult for me because the code field is a hidden field. I'm assuming you didn't give hidden fields the same abilities as text fields because normally, people can't change the values of hidden fields. That said, if hidden fields did have the same abilities as text fields, I suppose I could set up an event to compare if the value was equal to a url param (assuming I could use php in the event setup to return the 'key' url param's value). All said and done though, I hope I'm missing something because this seems quite a bit more messy than just being able use code to set my condition as above.
In converting one of my CF5 forms to CF6, I'm trying to recreate an event switcher. I saw in the demo that you have for the Data Source: {data:product}. However, in the past, we were about to use code directly in the event switcher to customize our condition. For example, if I wanted to compare a field value to a GET param, I had done something like this:
<?php
if ($form->data["code"] == $_GET['key'])
{
return"success";
}
else
{
return "fail";
}
I see in the instructions this:
{function:FUNCTION_NAME} or {fn:FUNCTION_NAME}
Run a function, function must be created under the Events tab.
Would I need to use a custom code (php) action before my event switcher, or do I need to go back to my designer and add something to the events tab?
As an aside, if I need to set up an event on a field for my switch condition to operate off of, that becomes difficult for me because the code field is a hidden field. I'm assuming you didn't give hidden fields the same abilities as text fields because normally, people can't change the values of hidden fields. That said, if hidden fields did have the same abilities as text fields, I suppose I could set up an event to compare if the value was equal to a url param (assuming I could use php in the event setup to return the 'key' url param's value). All said and done though, I hope I'm missing something because this seems quite a bit more messy than just being able use code to set my condition as above.