Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS CF DropDown Not Passing Variables

Status
Not open for further replies.

KOVMoe

Programmer
Jun 30, 2004
34
US
I am trying to populate a drop down box with a query, this part works. I then need to send the information to the next page, I use a JS. I cannot get my variables to populate and go to the correct page. Can anybody help?

Here is the code in question....

function #strFuncID#_FilterShp(strShrAcNr, strDate) {
#strFuncID#_frmKeyEntry.strShrAcNr.value = strShrAcNr;
#strFuncID#_frmKeyEntry.#strFuncAction#.value = 'FilterShp';
#strFuncID#_frmKeyEntry.dtmSelectedDate.value = strDate;
#strFuncID#_frmKeyEntry.intXlsExport.value = 0;
#strFuncID#_frmKeyEntry.submit();
}


----\
<cfform name="#strFuncID#_frmKeyEntry" action="#IPS_objPortalSessionData.strCurrentPath#" method="post">
<input type="hidden" name="#strFuncName#" value="ReportPostcard">
<input type="hidden" name="#strFuncAction#" value="">
<input type="hidden" name="strSelectedOps" value="#FORM.strSelectedOps#">
<input type="hidden" name="dtmSelectedDate" value="#FORM.dtmSelectedDate#">
<input type="hidden" name="dtmEndDate" value="#FORM.dtmEndDate#">
<input type="hidden" name="strShrAcNr" value="">
<input type="hidden" name="strUsrNr" value="">
<select name="strShrAcNr">
<cfloop query="qryShp1">
<option value="#trim(Shr_Ac_Nr)#">#trim(Shr_Ac_Nr)#</option>
</cfloop>
</select>
<input type="Submit" value="Filter" onClick="#strFuncID#_FilterShp('strShpAcNr','dtmSelectedDate');">
</cfform>

Thank you,

[king]Moe-King of the Village Idiots.

"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave
 
i take it that's being run on click when you submit the form?

you should use onsubmit instead in the form tag. also FilterShp('strShpAcNr','dtmSelectedDate'); you're passing the literal 'strshopAcNr' and 'dtmSelectedDate' values to the function. if those are supposed to be variables with values you're ont passing them correctly.
 
why are you even using a function anyway, everything you want to do can be done with straight html and hidden form elements.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
<form name="#strFuncID#_frmKeyEntry" action="#IPS_objPortalSessionData.strCurrentPath#" method="post">
<input type="hidden" name="#strFuncName#" value="ReportPostcard">
<input type="hidden" name="#strFuncAction#" value="FilterShp">
<input type="hidden" name="strSelectedOps" value="#FORM.strSelectedOps#">
<input type="hidden" name="dtmSelectedDate" value="#FORM.dtmSelectedDate#">
<input type="hidden" name="dtmEndDate" value="#FORM.dtmEndDate#">
<input type="hidden" name="strLabelNumber" value="">
<input type="hidden" name="strOrgAdPolDiv2Na" value="">
<input type="hidden" name="strOrgAdStrNr" value="">
<input type="hidden" name="strOrgAdStrNa" value="">
<input type="hidden" name="strUsrNr" value="">
<input type="hidden" name="intXlsExport" value="">
<select name="strShrAcNr">
<cfloop query="qryShp1">
<option value="#trim(shr_ac_nr)#" onclick="javascript:#strFuncID#_FilterShp('#trim(shr_ac_nr)#', '#xcp_dcv_dt#');">#trim(shr_ac_nr)#</option>
</cfloop>
</select>
<input type="submit" value="&nbsp;&nbsp;&nbsp;&nbsp;Filter&nbsp;&nbsp;&nbsp;&nbsp;">
</form>
This works.


Truth,
Because it is more important to some to show how smart they are. Not how they can code.



Thank you,

[king]Moe-King of the Village Idiots.

"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave
 
Truth,
Because it is more important to some to show how smart they are. Not how they can code.

If "some" were smart, they would use the smarter solution, not write bloated, problem prone code...

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top