Show Bid Request
Simple Form Java Script
Bid Request Id: 48881
|
|
|
Description:
I have a cold Fusion Form (See code below). There are two select box form fields: clientID and the second is TaskOrders.
I need the TaskOrders Select Box to be populated with the task orders available for a particular client (Via the client ID) whenever the client ID field changes.
Cold Fusion Form Code:
----------------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<cfquery name="Taskorders" datasource="#client.datasource#">
SELECT *
FROM
va_task_order
</cfquery>
<cfquery name="ClientsSelectBox" datasource="#client.datasource#">
SELECT
Name.ID,
Name.FULL_NAME,
Name.COMPANY,
Name.CITY,
Name.STATE_PROVINCE
FROM
Name
WHERE
Name.MEMBER_TYPE = 'CC' AND Name.COMPANY > ''
ORDER BY
Name.COMPANY_SORT
</cfquery>
<body>
<form name="HoursEntry" method="post" action="">
<div align="right">Client:</div> |
<select name="ClientID">
<option value="">Select Client to Bill</option>
<cfoutput query="ClientsSelectBox">
<!---
**** RAC: When this select box is changed, the available options in the
Task Order box must be changed ***
--->
<option selected value="">*Select Client to Bill*</option>
<option value="#ID#">#Company#; #City#, #State_Province#</option>
<else>
<option value="#ID#">#Company#; #City#, #State_Province#</option>
</cfoutput> </select> |
Sub-Client:
<input type="text" name="textfield2"> |
<div align="right">Task Order:</div> |
<select name="select4">
<option>Select Task Order if Applicable</option>
<cfquery dbtype="query" name="TaskOrdersForThisClient">
SELECT TaskOrder FROM TaskOrders WHERE TaskOrders.ID = #form.ClientID#
</cfquery>
<cfoutput query="TaskOrdersForThisClient">
<option value="#TaskOrder#">#TaskOrder#</option>
</cfoutput> </select> |
|
</form>
</body>
</html>
Deliverables: 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Complete ownership and distribution copyrights to all work purchased.
Platform:
Coldfusion 5 Dreamweaver MX
Must be 100% finished and received by buyer on:
Feb 21, 2003 EDT
Deadline legal notes: All times are expressed in the time zone of the site EDT (UT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EDT on the indicated date.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
|
This bid was accepted by the buyer!
|
$25 (USD)
|
Feb 19, 2003 9:45:02 AM EDT
|
10
(Excellent)
|
|
|
I already have a custom tag that will create as many dependant drop down selects as you want. I have them in several production environments and they work well even when you have 10,000 items!!!. The code is very good at not creating 'bloat' that is typical when controlls do not share script - my controlls do share code. Here is my info included in the tag source.
The purpose of this tag is to automatically create a selection box
that performs like a visual basic drop down - with pattern matching.
The resulting tag(s) are also dependant - one select box choice will
result in different choices (options) being filled in the next tag.
To acheive this functionality with greater speed (with thousands of
records possible) the groupings of options have been broken up into
javascript arrays that are named specifically using the values.
Pattern matching example: if the user types in 'ga' in a normal html select
you would first get the the first option that began with a 'g' and then
get the first option that matched to an 'a'. Pattern matching will display
the first option that began with 'ga' - etc. Press escape to clear out
the invisible 'word'.
Prompt & Match attributes: The prompt attribute allows the specification of the
first option to appear in the list - regardless of the sort order from the source
query. The matchval attribute allows setting the default selected option to
the option value that matches the matchval attribute - otherwise the prompt is
the default option chosen. If neither attribute is specified then there will not
be a default selected option.
Array name example - an array belonging to the 'states' tag on the 'form'
form for the parent value of 'EAST' would be named:
arrValformStatesEAST[0] = '';
arrTxtformStatesEAST[0] = 'Choose';
arrValformStatesEAST[1] = 'AL';
arrTxtformStatesEAST[1] = 'Alabama';
arrValformStatesEAST[2] = 'FL';
arrTxtformStatesEAST[2] = 'Florida';
////////////// Example of region, state, and city...//////////////////////
<cfquery name='GetRegions' datasource='tracking' >
SELECT Region_Name FROM Regions group by region_name ORDER BY Region_name
</cfquery>
<cfquery name='GetStates' datasource='orderszeus'>
SELECT Region_Name, State, StateDesc FROM vw_CityStateRegion GROUP BY Region_Name, State, StateDesc ORDER BY Region_Name, State
</cfquery>
<cfquery name='GetCities' datasource='orderszeus'>
SELECT State, City FROM vw_CityStateRegion GROUP BY State, City ORDER BY State, City
</cfquery>
<form name='form' action='test_ddd_tag.cfm' method='post'>
<!--- root tag --->
<cf_DependantDropDown
formName ='form' Name ='Regions'
OptQry ='GetRegions' OptQryGroupFld =''
OptValQryFld ='Region_Name' OptTxtQryFld = 'Region_Name'
ChildName ='States' siblings ='Cities'>
<!--- child tag --->
<cf_DependantDropDown
formName ='form' Name ='States'
OptQry ='GetStates' OptQryGroupFld ='Region_name'
OptValQryFld ='State' OptTxtQryFld ='StateDesc'
ChildName ='Cities'
matchVal='url.LocState' ParentMatchVal='url.Region'>
<!--- last one in bunch --->
<cf_DependantDropDown
formName ='form' Name ='Cities'
OptQry ='GetCities' OptQryGroupFld ='State'
OptValQryFld ='city' OptTxtQryFld ='city'
style='width: 100px;' matchVal='url.LocCity' parentMatchVal='url.LocState'>
</form>
////////////////////////////////////////////////////////////////////
In the above note that the first in the chain does not have a group name. The last in the
chain does not have a child. The sibling attribute should contain all the names of
dependant nodes below the current childs node. As above in the regions tag we only specify
the Cities tag - NOT the States tag.
*NOTE: that all tag names are converted to upper case - this should not matter to CF
but is important to JavaScript.
|
|
|
|
|
|