Chronoforms Event Switcher [GH] doesn't react

doromi 04 Oct, 2013
Hi,

I have problems to get Greyhead's Event Switcher to work.

In my form I have two submit buttons:
<input name="Schalter" id="Schalter" class="" value="Speichern" type="submit" />
<input name="Schalter" id="Schalter" class="" value="Mail" type="submit" />

To check whether the correct form data are submitted I put a Custom Code event
in the OnSubmit Event with the code
<?php 
echo "Schalter: " . $form->data['Schalter'] ."!";
?>

The data get transferred nicely - I get the output
Schalter: Speichern! bzw. Schalter: Mail!

Then I have added the Event Switcher to the On Submit Event with the code
<?php 
if ($form->data['Schalter'] == 'Mail')
{
   echo 'Mail abschicken';
    return 'event_b';
}
if  ($form->data['Schalter'] == 'Speichern')
{   if ($form->data['dateiname']) == '')
   { 
     echo "<script>alert(\"Datei ohne Namen.\");</script>";
     return 'event_c';
   }
   else
   {   
     echo "<script>alert(\"Datei speichern.\");</script>";
     return 'event_a';
   }
}
?>
I have added the actions to the three different events as needed, but
- nothing happens at all - neither those actions nor the echoes
noted in the Event Switcher's code...

I have the feeling that the Event Switcher does not get the data,
but I have no idea where it goes wrong.

Does anybody out there have an idea ?

Thanks...
Doris
GreyHead 05 Oct, 2013
Hi Doris,

This line
{   if ($form->data['dateiname']) == '')
has an extra ). It should be
{ if ( $form->data['dateiname'] == '' )


Bob
doromi 07 Oct, 2013
THANKS, Bob - that was it... Now it works...

Gee... One small bracket...

Kind regards,
Doris
This topic is locked and no more replies can be posted.