Submitting a CFFORM inside a CFDIV
I came across a problem submitting a CFFORM inside a CFDIV container. Normally any CFFORM submitted inside a CFDIV container will be posted back to the CFDIV (thanks CF for all the built in functions that make my life easy).... so I assumed below would work...
2 Items Per Page:
3 <cfselect name="sortby" onChange="submit()">
4 <option value ="0"></option>
5 <option value ="0">Lowest Price</option>
6 <option value ="1">Highest Price</option>
7 </cfselect>
8 </cfform>
but because I was not using the regular submit button none of ColdFusion's built-in ajax form submission events were being triggered as a result.
a simple work around...
2submitsortby = function() {
3javaScript:ColdFusion.navigate('productpage.cfm','productlistDiv',null,null,'get','sortbyFrm');return false;
4}
5</script>
6
7
8<cfform id="sortbyFrm" name="sortbyFrm">
9 Items Per Page:
10 <cfselect name="sortby" onChange="submitsortby()">
11 <option value ="0"></option>
12 <option value ="0">Lowest Price</option>
13 <option value ="1">Highest Price</option>
14 </cfselect>
15 </cfform>
however I am curious as there must be a another way to call CF's built-in AJAX form submission event without using "ColdFusion.navigate"? I have tired a number of other things like using "document.sortbyFrm.submit(), ColdFusion.ajax.submitForm()" but with no results.
Dec02



02/12/08 17:54
Interesting dilemma.
What happens if you use ColdFusion.Ajax.submitForm(formId, URL[, callbackhandler, errorhandler, httpMethod, asynch]) ?