AFAIK the action page you submit to in this case must return only a string and
the callback function can only handle that one string. You can delimit the
string and parse it though.
>From the docs:
callbackhandler
The JavaScript function to handle a normal response. The function must take a
single argument, that contains the response body. This method is used only if
the form submission is asynchronous.
Hope that helps!
/m
: Hello all. Does anyone have a suggestion to make regarding the following
: quandary I find myself in?
: I'm trying to submit a form from inside a javascript function thus:
: function SubmitFmGenInfo145(action){
: //form validation code (omitted here), then:
: ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' +
: action,GenInfoCallback(action,'145'));
: }
: When I do so, the callback function, shown below, executes correctly. It shows
: by the alert statements that it received the parameters, and by the state of
: the screen that it executed the populateGenInfo.cfm call (I haven't tested it
: for inserting yet). However, the form does not get submitted, and Firebug
: complains with the following error message: 'uncaught exception:
: ColdFusion.Ajax.submitForm: Form not found, form id: fmGenInfo'.
: function GenInfoCallback(mode,typegroup){
: alert(mode); alert(typegroup);
: ColdFusion.navigate('populateGenInfo.cfm','getGenInfo');
: url = (typegroup == '145') ? 'populateTx.cfm' : 'populateTkdnOrApp.cfm';
: if (mode == 'insert'){
: ColdFusion.navigate(url,'getTx');
: ColdFusion.navigate('populateSpecInstr.cfm?mode=no','getSpecInstr');
: }
: }
: However, the form most definitely does exist in the page, as Firebug's View
: Gererated Source makes clear. (Thank goodness Firebug has this ability;
: otherwise I could never be completely certain what the <cfdiv> contains!)
: Furthermore, when I do nothing but remove the reference to the callback
: function, changing the submitting function to the form shown below, Firebug
: does not complain, and the form submits flawlessly.
: function SubmitFmGenInfo145(action){
: //form validation code (omitted here), then:
: ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' + action);
: }
: What could be going on here? Is one not supposed to send parms to a callback
: function? Or am I perhaps using the wrong syntax for doing so?
: Thanks in advance for your ideas,
: Peyton
: -------------------------------------------------------------
: Annual Sponsor FigLeaf Software - http://www.figleaf.com
: To unsubscribe from this list, manage your profile @
: http://www.acfug.org?fa=login.edituserform
: For more info, see http://www.acfug.org/mailinglists
: Archive @ http://www.mail-archive.com/discussion%40acfug.org/
: List hosted by http://www.fusionlink.com
: -------------------------------------------------------------
Mischa Uppelschoten
The Banker's Exchange, LLC.
4200 Highlands Parkway SE
Suite A
Smyrna, GA 30082-5198
Phone: (404) 605-0100 ext. 10
Fax: (404) 355-7930
Web: www.BankersX.com
Follow this link for Instant Web Chat:
http://www.bankersx.com/Contact/chat.cfm?Queue=MUPPELSCHOTEN
---------- Original Message ----------
FROM: Peyton Todd <[EMAIL PROTECTED]>
TO: [email protected]
DATE: Tue, 15 Jan 2008 14:30:04 -0500 (EST)
SUBJECT: [ACFUG Discuss] Ajax.submitForm Conundrum
Hello all. Does anyone have a suggestion to make regarding the following
quandary I find myself in?
I'm trying to submit a form from inside a javascript function thus:
function SubmitFmGenInfo145(action){
//form validation code (omitted here), then:
ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' +
action,GenInfoCallback(action,'145'));
}
When I do so, the callback function, shown below, executes correctly. It shows
by the alert statements that it received the parameters, and by the state of
the screen that it executed the populateGenInfo.cfm call (I haven't tested it
for inserting yet). However, the form does not get submitted, and Firebug
complains with the following error message: 'uncaught exception:
ColdFusion.Ajax.submitForm: Form not found, form id: fmGenInfo'.
function GenInfoCallback(mode,typegroup){
alert(mode); alert(typegroup);
ColdFusion.navigate('populateGenInfo.cfm','getGenInfo');
url = (typegroup == '145') ? 'populateTx.cfm' : 'populateTkdnOrApp.cfm';
if (mode == 'insert'){
ColdFusion.navigate(url,'getTx');
ColdFusion.navigate('populateSpecInstr.cfm?mode=no','getSpecInstr');
}
}
However, the form most definitely does exist in the page, as Firebug's View
Gererated Source makes clear. (Thank goodness Firebug has this ability;
otherwise I could never be completely certain what the <cfdiv> contains!)
Furthermore, when I do nothing but remove the reference to the callback
function, changing the submitting function to the form shown below, Firebug
does not complain, and the form submits flawlessly.
function SubmitFmGenInfo145(action){
//form validation code (omitted here), then:
ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' + action);
}
What could be going on here? Is one not supposed to send parms to a callback
function? Or am I perhaps using the wrong syntax for doing so?
Thanks in advance for your ideas,
Peyton
-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------
-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------