Hi all,

I'm implementing a cforms usecase and I'm having trouble with the way
of cancelling it. I've implemented it as suggested in the file
dynamicrepeater_template.xml included in the cforms module. It says:


[quote]
<ft:form-template method="POST" ajax="true">
...
...
  <input type="hidden" id="lenya.submit" name="lenya.submit" value="ok"/>
...
...
<ft:widget id="ok"/>
     <!-- If you want a cancel button you beware to change the
lenya.submit value!!! like: -->
     <br/>
     <input i18n:attr="value" type="submit" name="cancel"
value="Cancel" 
onClick="document.getElementById('lenya.submit').value='cancel'"/>
...
...
[/quote]

I've added a cancel widget in my form definition (otherwise I get an
error message) and have implemented the submit and cancel buttons
following this example. It doesn't work because clicking on the Cancel
button generates the following request parameters, among others:

[quote]
PARAM: 'forms_submit_id' VALUES: '[cancel]'
PARAM: 'lenya.submit' VALUES: '[cancel]'
[/quote]

and they don't match the following if-else clause in usecases.js:

[code]
//HEADSUP: Cform do not allow id="submit" anymore. Use id="ok" for
now (till it is settled on cocoon-dev).
if (cocoon.request.getParameter("submit")||
  cocoon.request.getParameter("lenya.submit")=="ok") {

//Execute the usecase

} else if (cocoon.request.getParameter("cancel")) {

//Cancel the usecase

}
[/code]

I'm new to Cforms  and I don't know why the cancel button changes its
name to forms_submit_id when the form is submitted.

I'd like to know if I'm missing something obvious or if  there is a
workaround to this problem.

Thanks,

Paloma


--
Paloma Gomez

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to