Hi,
I have the following javascript:
Which executes nicely. What i'd like to do is remove the hardcoded "||" statements and "== '15'" statements and instead loop through a ValueList that I have set from a query. Any advice on how to pass the CF ValueList to javascript and loop accordingly?
This loop returns the same variables hard coded in the javascript above:
<cfloop index = "category_ID" list = "#TheList#" delimiters = ",">
<cfoutput>#category_ID#</cfoutput><br>
</cfloop>
Thanks!
RR
I have the following javascript:
Code:
<script type="text/javascript">
function show() {
if((document.myForm.Category.options[document.myForm.Category.selectedIndex].value == '13') || (document.myForm.Category.options[document.myForm.Category.selectedIndex].value == '14' ) || (document.myForm.Category.options[document.myForm.Category.selectedIndex].value == '15') || (document.myForm.Category.options[document.myForm.Category.selectedIndex].value == '16')){
document.getElementById('ShowSizes').style.display='block';
}
else
{document.getElementById('ShowSizes').style.display='none';}
}
</script>
Which executes nicely. What i'd like to do is remove the hardcoded "||" statements and "== '15'" statements and instead loop through a ValueList that I have set from a query. Any advice on how to pass the CF ValueList to javascript and loop accordingly?
This loop returns the same variables hard coded in the javascript above:
<cfloop index = "category_ID" list = "#TheList#" delimiters = ",">
<cfoutput>#category_ID#</cfoutput><br>
</cfloop>
Thanks!
RR