Thank you!
-----Original Message-----
From: Bruce, Rodney S HQISEC/Veridian IT Services
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:07 PM
To: CF-Talk
Subject: RE: -OT- Javascript and combo boxes
Thane
You might want to look into Fusionscript at www.fusionscript.com
With this you can do calls back to the database without refreshing your
page.
This is an example of a FS function:
<!----start of FS function-------->
<cf_fs_function name="MyFunction">
<!---Calls the server page with the CF query---->
<!---and passes the var for your query, from your select box--->
<cf_fs_activeServer action="call"
page="getSubDepts.cfm"
Department= form.MainDept>
<!----Loops through the returned query to populate the next select
box--->
<!---SubDepts will be the next Select box---------->
<cf_fs_loop query="SubDepts">
<cf_fs_select action="addOption"
field="'SubDepts'"
value="query.SubDepts.SubDeptsID"
text="query.SubDepts.SubDeptstext">
</cf_fs_loop>
</cf_fs_function>
<!----You can call the function like so------------>
<select name="MainDept" size="1" onChange="<cf_fs_function
call="MyFunction"/>">
<option value="0" SELECTED>Dept2</option>
....
</SELECT>
Then on your Serverpage (just the CF template with the query code) you would
have something like:
<!--------------------------->
<!---Query to get info------>
<CFQUERY name="QgetSubs">
Select *
WHERE Dept = #ActiveServer.Department#
</CFQUERY>
<!---returns query info back to calling page for use in populating your
select box-------> <cf_fs_activeServer action="return" name="SubDepts"
value="#QgetSubs#" type="query">
You could have as many calls in the function as you needed to populate any
number of select boxes. you can run any CF code on the server page.
-----Original Message-----
From: Thane Sherrington [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:32 AM
To: CF-Talk
Subject: Re: -OT- Javascript and combo boxes
At 10:39 AM 4/1/03 -0600, Chris Montgomery wrote:
>Howdy Thane,
>
>Tuesday, April 1, 2003, 10:03:33 AM, Thane Sherrington wrote:
>
> > Is it possible to use Javascript to select a choice in a combo box?
>
> > For instance, if I have a form with people listed, and beside each,
> > a
> combo
> > box with all the departments in the company, can I select a
> > department
in
> > the first combobox, and have the other combo boxes automatically
> > switch
to
> > that department as well?
>
>Yes. Look for the CF_TwoSelectsRelated custom tag in the Macromedia CF
>Exchange.
I don't think this is what I want. I've got about 30 combo boxes, all
with four or five departments. What I want to do is when I select the
first department for the first person, the following boxes change to that
department. Then if I change the department for the second person, I want
the remaining boxes to change to that.
T
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4