Hello All,
I have a basic ColdFusion form with input boxes and combo boxes. The combo boxes are populated by CF queries. After submittal of the form, I do some server side error checking on the action page. If an error occurs, I display the error to the user and provide a link (simply window.history.back()) for him or her to return to the form to correct data. Sounds simple right? Well, here is where the complication comes in...at least for me anyhow. One of the combo boxes has an "OnChange" event that causes other fields to be populated. If I don't select anything from that combo box and force the error, the history is retained, but if something is selected from that combo box and an error occurs, the history disappears. Not only the combo box info is gone, but all the other information that I filled in as well...just sends me back to a blank form. Any help would be appreciated!
The code is pretty simple on the action page...just the CF validation and the window.history.back(); link. Below is the combo box.
<cfquery name="QRY_JOB_TYPES" atasource="#LAP_DATA_SOURC
E#">
SELECT JOB_TYPE_DESC, DEFAULT_DAYS
FROM tab_JOB_TYPES
ORDER BY JOB_TYPE_DESC
</cfquery>
<select name="cmb_Type" size="1" onchange="Javascript:PopDa
tes()">
<option value="" selected>
<cfloop query="QRY_JOB_TYPES">
<option value="#QRY_JOB_TYPES.JOB_
TYPE_DESC#
"><font class="ArialBlk8">#QRY_JOB
_TYPES.JOB
_TYPE_DESC
# (average completion in #QRY_JOB_TYPES.DEFAULT_DAY
S# days)</font>
</cfloop>
</select>
<script language="JavaScript">
function PopDates()
<!--- Opens a popup that displays a please wait message and populates estimated start and end dates based on the job type selected --->
{
var typeindex = document.frm_JOB_ADD.cmb_T
ype.select
edIndex;
var selectedtype = document.frm_JOB_ADD.cmb_T
ype.option
s[typeinde
x].value;
var mypath = "JOB_POPULATE_DEFAULT_DATE
S_AND_USER
.cfm?URL_T
YPE=" + escape(selectedtype) + "&URL_BEG_DATE=" + escape(document.frm_JOB_AD
D.txt_EST_
START_DATE
.value);
window.open(mypath+"&rando
m="+Math.r
andom(),"m
ywin","scr
ollbars=1,
left=190,t
op=160,wid
th=160,hei
ght=80"); <!--- Opens Page And Refreshes Info From Server --->
}
</script>
Thanks!
Start Free Trial