I am trying to use EE conditional statement within Javascript. The Javascript is called through a EE snippet. Part of the problem is I am using js conditionals right below my EE conditional. Is this even possible with a EE if statement? Do I need to escape my if statement some how? Any suggestions would be greatly appreciated. Here is a simplification of my snippet:
<script type="text/javascript">
...
{if add_option_on=="On"}
if (thisForm.os2.value == "") {
alert('Please choose a {exp:channel:entries channel="products" disable="member_data|pagination" limit="1"}{customize_option_label}{/exp:channel:entries}');
return false;
}
{/if}
...
</script>
add_option_on
? Is that a global variable? – Siebird Dec 1 '12 at 3:42products
channel? – Siebird Dec 1 '12 at 3:46