cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [DAISY] Created: How do I implement a cancel button in Cocoon Forms?
Date Sun, 05 Mar 2006 17:39:02 GMT
A new document has been created.

Document ID: 860
Branch: main
Language: default
Name: How do I implement a cancel button in Cocoon Forms?
Document Type: FAQ
Created: 3/5/06 5:38:48 PM
Creator (owner): Bruno Dumon
State: publish


Mime type: text/xml
Size: 1112 bytes

<p>The key to implementing a cancel button -- or any button you where you want
to exit the current form and move on to somewhere else -- is to add an event
handler to the button which indicates to the form that it should end the form
processing, and then checking the if the submit widget of the form is the cancel

<p>Below follow some snippets which illustrate this.</p>

<p>In the form definition, add the declaration of a cancel button:</p>

<pre>    &lt;fd:action id="cancel"&gt;

<p>In the flowscript, after the <tt>form.showForm</tt> function returns,
you can
check if the user pressed the cancel button using form.submitId:</p>

<pre>    var form = new Form("myform.xml");

    if (form.submitId == "cancel") {
      // the user pressed cancel


Tags: forms

The document belongs to the following collections: documentation

View raw message