Yikes- I am at my wits end; I've been searching the internet for codes to help but no luck.
Currently I create forms in Marketo and have been using a code to make it so that a field appears only when a certain option is selected.
The code is below. If a person selects "Yes" in the "Contact" field, the dynamic field "FirstName" pops up for them to input their name.
If they select "No" in the "Contact" field, the dynamic field stays hidden.
However, I need to replicate this action on a form I'm creating in Eloqua. I tried essentially copying and pasting the code onto the landing page, but it isn't working and nothing happens to the "FirstName" field, which makes me think the code below was made specifically to be made for Marketo.
Please take a look and let me know how to address this- Thank you so much!!!
var $jQ = jQuery.noConflict();
// some variables to track the LI and input element of the dynamic field
var websiteRow = $jQ("#FirstName").parents("li:first");
var websiteField = $jQ("#FirstName");
// when the triggering field changes...
var value = this.value;
// when "Yes", show the dynamic field and make it required
// when "No", hide the dynamic field