define your submit-button as part of the form:
<fd:submit id="btn1" action-command="btn1">
<fd:label>My First Button</fd:label>
</fd:submit>(it shows up in the template as any other ft:widget then)
then check in your js
if (form.submitId == 'btn1')
you can also get a hold of the submit-widget itself through
form.getWidget().getSubmitWidget()
for instance if that widget is inside a repeater you can retrieve in which row there was a click through:
var clickedRowId =
form.getWidget().getSubmitWidget().getParent().getId();which can quite directly be used as an index into the list/array structure that was bound to the repeater.
HTH, -marc=
Derek Hohls wrote:
I am trying to work out how to get different pages being displayed from a CForm submission, depending on different submission buttons...
For one submission buttton, I have:
<ft:form-template action="#{$continuation/id}.continue" method="POST"> ... <input type="submit"/> </ft:form-template>
In the flowscript, this then results in a form.save(document);
being attempted.
I would like to have a number of input buttons, and depending on which is pressed, handle this in the flowscript along the lines of:
if (buttonPushed == "btn1") { cocoon.sendPage("test1")
}
if (buttonPushed == "btn2") { cocoon.sendPage("test2")
}
and so on...
Is this possible and, if so, how?
Thanks Derek
-- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
