I just did this. In a nutshell, I downloaded a module (mod_php) that let me run javascript, HTML, and PHP in a module position, and I placed my code in there. The resulting drop down was then in that module position.
Then I modified the code I found
here
, to render the AJAX.
To find the correct SQL statements, I went it to PHP myAdmin, and looked. The main SQL table that contains the CB fields, is "jos_comprofiler_fields". I wanted the first dropdown box to match fields in that table that began with "cb_sub". The result is below:
Code:
SELECT fieldid, title FROM `jos_comprofiler_fields` where `name` LIKE 'cb_sub%' LIMIT 0, 30
Once you dl the PHP mod, create a new module type of mod_php. You can test it by entering in what's below. If done correctly, then it should give you a dropdown list of whatever matches the SQL statement contained in the $sql variable.
Code:
<?
$sql = "SELECT fieldid, title FROM `jos_comprofiler_fields` where `name` LIKE 'cb_%' ";
$result = mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
$id=$row["fieldid"];
$thing=$row["title"];
$options.="<OPTION VALUE=\"$id\">".$thing.'</option>';
}
?>
<select name="mainCategory">
<option>Please Select</option>
<?=$options?>
</select>
It was much more involved, but those two things should get you on the right path. Although I'm no expert by any stretch of the imagination, I did successfully get it working, and this is how I did it. Let me know what more help you need.