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 to javascript variable not working as expected

  1. I have a form set up with a radio button group for selecting from a list of job functions (Administration, Instruction, Technical / IT).

    Upon form submission a post is created.

    In the post body field I have a javascript with a variable (var JobFunction = {Which of the following best describes your job function?:4};).

    The merge tag is being passed like this:
    var JobFunction = Technical / IT;
    rather than
    var JobFunction = "Technical / IT";

    Is there some way I can pass the merge tag as a string?

    In the script I'm trying to test the variable and use the value to set some other variables like follows:

    if (JobFunction=="Technical / IT"){ do something }

    The problem is that my if statement doesn't work because it doesn't seem to see the variable as a string.

    Posted 11 years ago on Monday June 18, 2012 | Permalink
  2. please disregard. i figured this one out.

    Posted 11 years ago on Tuesday June 19, 2012 | Permalink
  3. David Peralty

    Glad to hear it. :)

    Posted 11 years ago on Tuesday June 19, 2012 | Permalink

This topic has been resolved and has been closed to new replies.