Ask a Question related to Coldfusion Database Access, Design and Development.
-
larksys #1
need sql javascript help
The attached code shows that I am updating a select list from a query. However,
I need to revise the list every time the user type into the company box
(thereby giving them a company name to select). I think I need to do the query
in javascript and not CF.
<script language="JavaScript" type="text/javascript">
function doFilter(pattern, list){
if (!list.bak){
list.bak = new Array();
for (n=0;n<list.length;n++){
list.bak[list.bak.length] = new Array(list[n].value, list[n].text);
}
}
match = new Array();
nomatch = new Array();
for (n=0;n<list.bak.length;n++){
if(list.bak[n][1].toLowerCase().indexOf(pattern.toLowerCase())!=-1){
match[match.length] = new Array(list.bak[n][0], list.bak[n][1]);
}else{
nomatch[nomatch.length] = new Array(list.bak[n][0], list.bak[n][1]);
}
}
for (n=0;n<match.length;n++){
list[n].value = match[n][0];
list[n].text = match[n][1];
}
for (n=0;n<nomatch.length;n++){
list[n+match.length].value = nomatch[n][0];
list[n+match.length].text = nomatch[n][1];
}
list.selectedIndex=0;
}
</script>
<cfparam name="executive" default="">
<cfparam name="jobagent" default="">
<cfparam name="resume" default="">
<cfparam name="contract" default="">
<cfform action="signup3.cfm" name="form" height="600" width="680"
format="html" preservedata="Yes">
<div class="d2" align="center">BASIC INFORMATION</div><br>
<br>
<cfquery name="Compquery" datasource="taxtalentdb" dbtype="ODBC"
username="tax-talentdata" password="tony12">
SELECT Top 10 Company_Name,Company_City FROM cstatic WHERE Company_Name LIKE
'%excompany%'
</cfquery>
<table width="100%">
<tr>
<td width="15%" nowrap="nowrap"><strong><font size="+1"
color="orange">»</font>Current Company</strong></td>
<td width="35%"><cfinput type="text" name="excompany" required="Yes"
label="Current Company:" message="Current Company is a required field."
width="300" tabindex="" onkeyup="doFilter(this.value,this.form.CompSelect) "
onchange="doFilter(this.value,this.form.CompSelect )"/>
<cfoutput query="Compquery">
<select name="CompSelect">
<option value="#Company_Name#" & "* " & "#Company_City#">#Company_Name# *
#Company_City#</option>
</select></td>
</cfoutput>
larksys Guest
-
Include javascript in a javascript file
Hello, Is there a way to include a javascript file from WITHIN a javascript file? Something similar as in the "#include" directive in C++? ... -
cfm to htm & javascript
We just upgraded from 5 to MX 7. We have a page that we flatten from cfm to htm. There are popup window links on the page in the form of... -
output text in control location; calling control javascript from page javascript
Hi; If you don't know, I'm just learning javascript and aspnet, but I have a pretty good grounding in windows programming. I'm trying to build a... -
JavaScript - How do you add an action to the JavaScript action menu
Greetings, I'd like to add custom script(s) to the drop down list of actions in Acrobat. We are creating an app where many authors will be... -
need javascript staff (anyone who knows javascript peroid) (READ)
hey its me ultimategamerx and im back in some clothes lol i need some people who know java script i need help please reply if ya know some



Reply With Quote

