• Resolved greenrooster

    (@greenrooster)


    Hello,

    Unsure of where to put feature requests, so here I am. Forminator is great (coming from Caldera, it’s the most versatile I’ve found) but there are some sticking points I’d like to see in the future, all concerning conditionals.

    1) I would love to see conditional hidden values. Example: If dropdown is “a” use {hidden-1}. If dropdown is “b” use {hidden-2} custom value. This helps me when it comes to feeding other parts of forms, like parts of urls. I can get around this by making duplicate fields and using conditional visibility, but that seems like a lot of bulk, especially if you need to use identical number or dropdown fields differently. For example, I want to by a quantity of shirts, but only one type per form submission. A red shirt is $5, a blue one is $10. The way I see setting this up at the moment is to either 1) have two different forms, 2) have a drop down that shows a different number field per color selection, or 3) choose a quantity and feed that to the value of a dropdown. Granted, this simple example is best done with option 3, not conditional hidden values. But the more complex a form gets, the more conditional visibility is applied, and the more calculations that are needed to get to the end of the form, the easier conditional hidden values become.

    2) Multiple and Conditional Redirects. I don’t like redirects all that much, but they are incredibly helpful. There’s no way to send someone to different locations depending on selection at the moment. You can’t feed field values into other field values at the moment (ex. value of {select-1} can’t be {hidden-1}, it just returns {hidden-1} when used.). Maybe this resolves itself in the backend, after the form is submitted. I haven’t tried yet. By having multiple and conditional redirects, I would be free to use the values of the select field in the example elsewhere in the form for calculations or the like.

    Otherwise, I really enjoy Forminator and I really look forward to using it more and more!

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hey there @greenrooster

    Just to be sure I understand #1: you mean have the ability to set the Default Value of a hidden field based on the value from another field in the same form?

    As for #2, while there is no option to set up multiple redirects in a form’s Submission Behaviour settings, it can be done using a field macro in the URL field there.

    See this post for a working example: https://premium.wpmudev.org/forums/topic/config-forminator-to-forward-user-to-a-page-based-on-the-zip-code-they-entered/

    Cheers!
    Patrick

    Thread Starter greenrooster

    (@greenrooster)

    Hi @wpmudevsupport16,

    #1: not exactly. I know you can populate hidden values with other fields already. This is more setting a hidden value and using it’s value based on another field’s selection.

    For a sudo-code example, if you chose a blue shirt in the option below:

    <select name="shirts" id="shirts">
      <option value="5">Blue Shirt</option>
      <option value="10">Red Shirt</option>
      <option value="15">Green Shirt</option>
    </select>
    
    <?php
    function condition($option){
    
      $hidden-1, $hidden-2, $hidden-3 = null;
    
      if( $option == 'Blue Shirt' ) {
        return $hidden-1 = 'Blue Jeans';
      } elseif( $option == 'Red Shirt' ) {
        return $hidden-2 = 'Red Jeans';
      } elseif( $option == 'Green Shirt' ) {
        return $hidden-3 = 'Green Jeans';
      }
    
      echo 'Your' . $option . 'costs $' . $option[value] . 'and would look good with' . $hidden-1 . $hidden-2 . $hidden-3;
    
    // 'Your Blue Shirt costs $5 and would look good with Blue Jeans.
    // Only $hidden-1 is specified, thus is the only hidden value pulled.
    

    Caldera Form’s conditions are more robust in that you can essentially disable hidden values if a condition isn’t met. (maybe that would have been simpler to say from the get go.

    #2 Field macro in the URL field. Huh. I’ll take a look. That might be exactly what I’m looking for.

    Thanks so much!

    • This reply was modified 3 years, 9 months ago by greenrooster.
    Thread Starter greenrooster

    (@greenrooster)

    Just to let you know, I think the solution you mentioned for the multiple urls works basically. However, it doesn’t work if you’re trying to pass different query variables based on user input. I can’t seem to be able to pass field data into field values, which would make your solution work and allow for more advanced situations.

    #2 could potentially be solved with #1. I wouldn’t need to pass data into value fields if I was able to conditionally use hidden field values.

    There might not be a solution to this at the moment. It might not exist. And that’s okay, that’s why it’s a feature request ??

    Thanks!

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello there @greenrooster

    I really appreciate the time spent here ?? I’ve already shared your request with the Forminator team for further consideration.

    Take care,
    Dimitris

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feature Request: conditionals’ is closed to new replies.