<cfquery name="getCategories" datasource="#mydatasource#" username="#myusername#" password="#mypassword#"> SELECT * FROM categories WHERE type = 'cat' ORDER BY id </cfquery> <cfform action="engine.cfm" method="post" format="html"> <table cellpadding="0" cellspacing="0"> <tr> <th colspan="2">New Category</th> </tr> <tr> <td>Category Type:</td> <td> <select name="type"> <option value=" "></option> <option value="cat">Main Category</option> <option value="sub">Sub Category</option> </select> </td> </tr> <tr> <td>Name:</td> <td><cfinput type="text" name="title" size="20" maxlength="100" required="yes" message="A name for the category is required."></td> </tr> <tr> <td>Parent Category:</td> <td> <cfselect enabled="Yes" name="parentcat" multiple="no" query="getCategories" value="id" display="title" queryPosition="below"> <option value=" "></option> </cfselect> </td> </tr> <tr> <td colspan="2"><cfinput type="submit" name="submit" value="Submit" validate="submitonce" validateat="onserver,onsubmit"></td> </tr> </table> </cfform>
I want the <cfselect> tag to display on if Sub Category is selected on the first <select> tag. I expect that it will use the onchange attribute but other than that I have no idea.

New Topic/Question
Reply



MultiQuote





|