here's some code:
<cfquery datasource="exampleapps" name="q1">
select FirstName from tblEmployees
</cfquery>
<cfquery datasource="exampleapps" name="q2">
select LastName from tblEmployees
</cfquery>
<cfset i = 0>
<script language="JavaScript1.2">
aTemp1 = new Array();
<cfoutput query="q1">
aTemp1[#i#] = "#FirstName#";
<cfset i = i + 1>
</cfoutput>
</script>
<cfset i = 0>
<script language="JavaScript1.2">
aTemp2 = new Array();
<cfoutput query="q2">
aTemp2[#i#] = "#LastName#";
<cfset i = i + 1>
</cfoutput>
</script>
<script language="JavaScript1.2">
function foo()
{
document.forms[0].one.length = aTemp1.length;
for(i=0;i<aTemp1.length;i++)
{
document.forms[0].one.options[i].text = aTemp1[i];
document.forms[0].one.options[i].value = aTemp1[i];
}
}
function bar()
{
document.forms[0].two.length = aTemp2.length;
for(i=0;i<aTemp2.length;i++)
{
document.forms[0].two.options[i].text = aTemp2[i];
document.forms[0].two.options[i].value = aTemp2[i];
}
}
</script>
<form>
<input type="button" name="test" value="test" onclick="foo()">
<select name="one" onblur="bar()">
</select>
<select name="two">
</select>
</form>
-----Original Message-----
From: Webmaster [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 4:39 PM
To: CF-Talk
Subject: RE: Newbie Needs Help
IE
-----Original Message-----
From: Frank Mamone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 3:30 PM
To: CF-Talk
Subject: Re: Newbie Needs Help
IE or Netscape or both?
----- Original Message -----
From: "Webmaster" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, September 03, 2002 4:02 PM
Subject: Newbie Needs Help
> Can someone tell me where I might get a Javascript so that when the focus
> changes from one field it automatically updates another from a query.
> Example: I sell product a and b, in the database I have a products column
> and a y/n column that will let them know if it is available and a cost
> column. The first field is changed to product a, I want the other 2 text
> boxes to change to display whether it is available and the cost of product
> a.. I am using CF 4.5 and access 2000.
>
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists