I used the window.alert but tested in chrome and it give this
error:
Chrome JavaScript Debugger
Type 'help' for a list of commands.
attached to World Of Jokes, Jokes Arena
uncaught exception ReferenceError: subcat is not defined
<cfinvoke component="core.cfc.jokes"
method="subcategories" returnvariable="getDetals"/>
<script language="JavaScript1.2">
function populate(obj) {
var subcats = new Array(
<cfoutput query="getDetals" group="maincategoryName">
<cfoutput>new
Array(#currentrow-1#,"#catID#","#subcategory#","#mainID#")<cfif
currentrow NEQ recordcount>,</cfif></cfoutput>
</cfoutput>);
obj.subcat.options.length = 0;
window.alert("static text " + subcat);
obj.subcat[0] = null;
var optc = 0;
for(i=0;i<subcats.length; i++) {
if(subcats
[3] == obj.cat_ID.value) {
obj.subcat[optc] = new Option(subcats[2],subcats
[1]);
optc++;
} else {
obj.subcat[0] = new Option("- Please select a category
-","null");
window.alert("static text " + subcat);
}
}
}
window.alert("static text " + subcat);
function handleChange(v) {
if(v==2 || v==3) {
document.getElementById('uploadarea').style.display='';
} else {
document.getElementById('uploadarea').style.display='none';
}
}
window.alert("static text " + subcat);
</script>
<select name="cat_ID" onChange="populate(this.form);
handleChange(this.options[this.selectedIndex].value);">
<option selected="selected">- Select a Category
-</option>
<cfoutput query="getDetals" group="maincategoryName">
<option
value="#mainID#">#maincategoryName#</option>
</cfoutput>
</select>
<tr>
<td>Select Subcategory:</td>
<td>
<select name="subcat">
<option>- Please select a category -</option>
</select>
</td>
</tr>
<div id="uploadarea" style="display:none">
<tr>
<td>Upload File:</td>
<td><input type="file" name="upload" />
</td>
</tr>
</div>