I have a radio button with 2 options on page 1 of a multi form
add=Add (Ignores year)
edit=Edit (Year above)
page 2 has a custom code (just to check)
which works fine and shows add or edit as required and for edit reads the appropriate record from the DB
But the event switcher never triggers the add event, only the edit event
I have tried "add" instead of 'add' which has no effect. What am I doing wrong.
add=Add (Ignores year)
edit=Edit (Year above)
page 2 has a custom code (just to check)
<p>Form <?php echo $form->data["addedit"]; ?> --</p>
which works fine and shows add or edit as required and for edit reads the appropriate record from the DB
But the event switcher never triggers the add event, only the edit event
<?php
if ($form->data["addedit"] == 'add') {
return "add";
} else {
return "edit";
}
?>
I have tried "add" instead of 'add' which has no effect. What am I doing wrong.
Hello olaeblue,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How do I build a select drop-down, radio button or checkbox group?
What are the differences between select drop-downs, radio buttons and checkboxes?
How can I get useful data from select drop-downs, checkboxes and radio buttons?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How do I build a select drop-down, radio button or checkbox group?
What are the differences between select drop-downs, radio buttons and checkboxes?
How can I get useful data from select drop-downs, checkboxes and radio buttons?
P.S: I'm just an automated service😉
How do you know that the "add" event is never triggered ? how do you have the form events setup ? and how do you have the "event switcher" setup ?
You may also check the value using a "debugger" action before the "event switcher".
Regards,
Max
You may also check the value using a "debugger" action before the "event switcher".
Regards,
Max
Max
I have an event switcher and some custom code <p>add</p> or <p>edit</p> as appropriate.
[attachment=0]Capture.JPG[/attachment]
edit works with both the word edit appearing and the record being loaded from the DB
the word add never appears!!
I have now tried using a dropdown with id = 1 for add and otherwise edit but adain add never triggers
The debugger sees YearPicker as 1
[attachment=1]Capture.JPG[/attachment]
but no word add
[attachment=2]add.JPG[/attachment]
but for any value not 1 I do get the edit word
[attachment=3]edit.JPG[/attachment]
I have an event switcher and some custom code <p>add</p> or <p>edit</p> as appropriate.
[attachment=0]Capture.JPG[/attachment]
edit works with both the word edit appearing and the record being loaded from the DB
the word add never appears!!
I have now tried using a dropdown with id = 1 for add and otherwise edit but adain add never triggers
<?php
if ($form->data["YearPicker"] == 1) {
return "add";
} else {
return "edit";
}
?>
The debugger sees YearPicker as 1
[attachment=1]Capture.JPG[/attachment]
but no word add
[attachment=2]add.JPG[/attachment]
but for any value not 1 I do get the edit word
[attachment=3]edit.JPG[/attachment]
BTW for all practical purposes the form is working as the add event doesn't actually do anything. But I really would like to understand what I'm doing wrong as next time I might want to actually use both events off a switcher.
Hi olaeblue,
The Event Switcher doesn't add the word 'add' to the $form->data array, it executes the actions in the 'add' sub-event - so, if the Custom Code 28 action in your form is empty then nothing will happen. Add some debug code to that action to test e.g.
Bob
The Event Switcher doesn't add the word 'add' to the $form->data array, it executes the actions in the 'add' sub-event - so, if the Custom Code 28 action in your form is empty then nothing will happen. Add some debug code to that action to test e.g.
<?php
$form->data['add'] = 'added';
?>
Bob
Hi Bob
Custom Code 28 has
Custom code 36 has
This was done as a quick 'debug' to check if event was firing right and how I realized the add event was never triggered. As per screen shots 'edit' does appear on the page, 'add' doesn't
As I said even trying a different trigger php script (based on a dropdown id, instead of a radio button value) still failed to trigger the add event.
Custom Code 28 has
<p>add</p>
Custom code 36 has
<p>edit</p>
This was done as a quick 'debug' to check if event was firing right and how I realized the add event was never triggered. As per screen shots 'edit' does appear on the page, 'add' doesn't
As I said even trying a different trigger php script (based on a dropdown id, instead of a radio button value) still failed to trigger the add event.
Hi olaeblue,
Did you manage to find out what's wrong ? if not then you can send me admin login details using the "Contact us" page and I can check it, just include a link to this topic in the message!
Regards,
Max
Did you manage to find out what's wrong ? if not then you can send me admin login details using the "Contact us" page and I can check it, just include a link to this topic in the message!
Regards,
Max
This topic is locked and no more replies can be posted.