Thanks for the links, I figured it out by looking at the
implementation of Shelane's plugin.
For reference. Here is my ASP code that returns the data in a JSON
type structure:
<%
dim critset, json, cat
cat = request("q")
set critset = server.createobject("Adodb.recordset")
sqlText = "SELECT DISTINCT [" & cat & "] FROM Station_Table;"
critset.open sqlText, oConn
do while not critset.eof
if trim(critset(cat)) <> "" then
json = json & "{oV: '" & critset(cat) & "', oT: '" & critset(cat) &
"'}, "
end if
critset.movenext
loop
critset.close
set critset = nothing
oConn.close
set oConn = nothing
json = left(json,len(json)-2)
response.write("[" & json & "]")
%>

And this is how I include it in the page:
<script type="text/javascript" src="jquery.selectCombo.js"></script>
<script language="JavaScript" type="text/javascript">
$(function(){
$('#cat').selectCombo('selectCombo.asp?setval=true', '#crit');
});
</script>

On Oct 30, 10:30 pm, Rob D <[EMAIL PROTECTED]> wrote:
> Hi Snooze,
>
> 1. Check out the following tutorials if you haven't already:
>
> http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jq...
>
> http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/
>
> 2. Check out Shelane's plugin:
>
> http://code.google.com/p/jqueryselectcombo/
>
> http://lasso.pro/selectCombo/
>
> 3. Check out my plugin:
>
> http://www.msxhost.com/jquery/linked-selects/json/
>
> Perhaps you can use the example php code in the download to work it out
> for ASP!
>
> Cheers
>
> Rob
>
>
>
> Snooze wrote:
> > I am trying to make a select box that with populate depending on what
> > is selected in the select box before it. Both of these select boxes
> > need to draw information from the sql database (I have to use ASP to
> > get this information).
>
> > I've been looking at some tutorials but am overall very confused as
> > how to accomplish this.
>
> > I understand that I need to look for a change in the first select box
> > to populate the second, but I don't understand how to tell ASP to
> > query for different information.
>
> > I would like something like this:
>
> > <select name="category" class="cat">
> > <option value="value from db">label from db</option>
> > <option value="value from db">label from db</option>
> > <option value="value from db">label from db</option>
> > </select>
>
> > (I get the list of categories from a database using ASP, there is 37
> > of them but this might change.)
>
> > <select name="criteria" class="crit">
> > <option value="value from db depending on cat chosen">label from db
> > depending on cat chosen</option>
> > <option value="value from db depending on cat chosen">label from db
> > depending on cat chosen</option>
> > <option value="value from db depending on cat chosen">label from db
> > depending on cat chosen</option>
> > </select>
>
> > (I need the criteria to be drawn from the database, preferrably using
> > ASP, there is also a different number of criteria for each category.)
>
> > __________ NOD32 2627 (20071030) Information __________
>
> > This message was checked by NOD32 antivirus system.
> >http://www.eset.com- Hide quoted text -
>
> - Show quoted text -

Reply via email to