Hi,
I have a standard Marketo Contact Us Form, that was created in Marketo Studio (typical drag and drop method) that is being used across multiple pages on a website. I have been charged with updating it to have the following dynamic logic:
> If "COUNTRY" picklist is selected and country value = US show "STATE" picklist
> If "STATE" picklist is selected and country value = "CA" show "POSTAL" code input field.
I am able to accomplish this dynamic logic using the show() / hide() methods on a DIV ID via JQuery. The problem, I have is "HOW" to efficiently apply this update on the exisiting standard Marketo Contact Us form without having to create a new Contact Us Form this new dynamic logic. For example Marketo generates the following code for the STATE picklist:
<li class='mktField'>
<label>State:</label>
<span class='mktInput'>
<select class='mktFormSelect' name="State" id="State" size='1'>
<option value='' selected='selected'>-- Please Select --</option>
<option value='AK'>AK</option>
........
<option value='WY'>WY</option>
</select>
<span class='mktFormMsg'></span>
</span>
</li>
In order to make my show() and hide() logic work. I need to wrap the code above with a new DIV ID like so:
<div id ='StateDisplay'>
<li class='mktField'>
<label>State:</label>
<span class='mktInput'>
<select class='mktFormSelect' name="State" id="State" size='1'>
<option value='' selected='selected'>-- Please Select --</option>
<option value='AK'>AK</option>
........
<option value='WY'>WY</option>
</select>
<span class='mktFormMsg'></span>
</span>
</li>
</div>
or add a new ID to the <li> tag like so:
<li class='mktField' id = 'StateDisplay'>
<label>State:</label>
<span class='mktInput'>
<select class='mktFormSelect' name="State" id="State" size='1'>
<option value='' selected='selected'>-- Please Select --</option>
<option value='AK'>AK</option>
........
<option value='WY'>WY</option>
</select>
<span class='mktFormMsg'></span>
</span>
</li>
Is this possible to do without creating a new contact us form and saving it as a template (This is the only place I know of where I have the flexibility to write custom code and modify Marketo's generated code e.g. add the DIV ID around the STATE picklist code etc.)
Thanks in advance for your time and help.