PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Merge tag label and value

  1. Hi,

    I've developed a quick online quote generator using GF. In the form, I used a dropdown for target translation language, and a "value" for the base rate. Then sent this label and value to the other page via querystring using the merge tags. So it redirects to something like:
    http://url.com/?target="Turkish"&rate="100"
    And the page prints this target language title, and multiplies this rate with the given input word count etc. This was working until recently.

    NOW IT'S NOT WORKING. :) And here ıs the bug I just fıgured out:
    When there are more than one choice in the dropdown list having the same "value", then it just sends the first one in the list as the merge tag.

    for example:
    Let's say my choices are:
    Arabic|110
    English|150
    Japanese|150
    Turkish|110

    And if we select Japanese, the merge tag uses "English" as the target in query string, and if we select Turkish, it would send "Arabic" as the target value.

    I think it's a bug, and it just happened. It was working fine a few updates back.

    Thank you.

    Posted 9 years ago on Wednesday August 22, 2012 | Permalink
  2. I believe the values need to be unique for this to work.

    What were the versions you upgraded from and to?

    Posted 9 years ago on Sunday August 26, 2012 | Permalink
  3. Hi,

    Thank you for the response.

    Now of course values must be unique for this logic to work but the values (prices) are not unique. My question is that it was working as it is now at some point. Now it needs to be unique.

    I don't know the exact versions because it's all on my clients server but we made the code about 6 months ago, and they reported me this bug last week. So it might have been changed anywhere in between.

    Posted 9 years ago on Monday August 27, 2012 | Permalink
  4. Hi, weptile,

    There has been a lot of new functionality added since six months ago, so I can't really say what version could have caused your form to stop working. I did some comparison of the code to the version from January, but didn't see any changes in the sections that deal with getting the drop down name for the value. The code gets the matching name using the value, which is why the first one that matches the value is used and what you are seeing.

    What you can do since your values aren't unique, is switch the drop down to a Product drop down and pass the information using merge tags to the next page the same way using your Product field. You can pass the price by adding ":price" to your product merge tag.

    Posted 9 years ago on Monday August 27, 2012 | Permalink
  5. Formmaker
    Member

    i have the same problem and i cannot use price to get out of it, is there a ":label" option?

    Posted 9 years ago on Thursday December 6, 2012 | Permalink
  6. David Peralty

    Have a look on this documentation page:
    http://www.gravityhelp.com/documentation/page/Merge_Tags

    Near the bottom, you can see the options we have available and what they do.

    Posted 9 years ago on Thursday December 6, 2012 | Permalink
  7. Formmaker
    Member

    i have read that many times now, thanks, i either am missing something or it is not there...

    "value (Applies only to drop down, checkboxes and radio button fields)
    Displays the selected item's value. Applicable if the field was configured with 'enable values'. {Field:5:value}"

    I understand that - problem - dropdown has multiple fields with same value and different label
    i.e.
    label 1|valuea
    label2|valuea
    label3|valueb
    label4|valuec
    label5|valuec

    - if i choose label 2, it gets valuea, but when i use a mergetag to get {label 2:id#} it returns label1. if I choose label 5 it gets valuec, but when i pull label with merge tag i get label4...

    Posted 9 years ago on Thursday December 6, 2012 | Permalink