Jump to content

Setting a Yes/No field in Javascript


Recommended Posts

I am trying to dynamically set a Yes/No field in addition to redirecting a user after completion of a submission page.

This is the code that I have in the Destination Page.  Virtual1 captures the type and YesNoVariable is the flag that I want set.

What I've done below does provide the right redirection based on the Virtual1 value but the value to set the YesNoVariable to true (or checked) does not.

<script type="text/javascript">

if("[@cbParamVirtual1]" == "Adoption")
{
 document.getElementById("InsertRecordYesNoVariable").checked=true;
 window.location = "http://page1?ProfileID=[@field:ProfileID]&ProfileFullName=[@field:ProfileFullName]";
} 
 else if("[@cbParamVirtual1]" == "Foster")
{
 window.location = "http://page2";
} else
{
 window.location = "http://otherpage";
}
</script>

Appreciate fixing my code and any help in understanding how to properly set this value.  Thanks in advance.

 

Link to comment
Share on other sites

@AtayBalunbalunan thanks for the reply.

I hadn't thought of the Triggered Action as an option but I do like it.  I was so focused on just leveraging the datapage to help manage the flow and information that I overlooked it but you are right, I would have to add a new value to pass the option to the triggered action.  Thanks.

I did look up the tech tip which led me to a part of the flow that I didn't show where it does navigate to a specific page based on the option.

 

Thing is, I still want to understand the right syntax to set Yes/No Boolean values in Javascript.  I keep feeling it shouldn't be as hard as it is, but for me, it is.

 

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...