This code don't work for me en Cocoon 2.1.7. I think its a problem with the _javascript_ type.

I use:

 
form.showForm();
 switch( String (form.submitId)) {
   case "details":
        showDetails();
        break;
   case "create":
        createNew();
        break;
   case "cart":
        redisplayForm = false;
        showCart();
        break;
   case "ok":
        redisplayForm = false;
        processForm(form);
        break;
  }



               

En/na Jeroen Reijn ha escrit:
Hi Fernando,

You can react in flow based on the submitId of the form.

You can request the submitId from flow by using:

form.submitId

Example:

 form.showForm();
 switch(form.submitId) {
   case "details":
        showDetails();
        break;
   case "create":
        createNew();
        break;
   case "cart":
        redisplayForm = false;
        showCart();
        break;
   case "ok":
        redisplayForm = false;
        processForm(form);
        break;
  }

I found the example in the archives.

Regards,

Reijn



[EMAIL PROTECTED] wrote:
How can one react differently in a flow when there are several fd:submit elements in a form?

 

Thanks


Kind regards,

Jeroen Reijn

Hippo

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



-- 
Josep A. Frau <[EMAIL PROTECTED]>
Centre de Tecnologies de la Informació
Universitat de les Illes Balears


Reply via email to