Hi,
I have an entry form and want to show how many places are available still. These data are stored in a simple textfile and the custom code block in the On Submit event seems to work fine. But I have a problem in displaying it in the form itself. I've tried a custom code element with php but this doesn't work. And a code block in the On Load event would work but how I populate the form with the data then?
Any help is appreciated
trunky
I have an entry form and want to show how many places are available still. These data are stored in a simple textfile and the custom code block in the On Submit event seems to work fine. But I have a problem in displaying it in the form itself. I've tried a custom code element with php but this doesn't work. And a code block in the On Load event would work but how I populate the form with the data then?
Any help is appreciated
trunky
Hi trunky,
You don't say how you want to display this data in your form?
You can use a Custom Code element to add a value to the $form->data array and then use that to set the value of an input; or echo it out directly from a Custom Element element.
Bob
You don't say how you want to display this data in your form?
You can use a Custom Code element to add a value to the $form->data array and then use that to set the value of an input; or echo it out directly from a Custom Element element.
Bob
Hi Bob,
I simply try to read a number from a textfile (and decrease it when someone has filled the form). The writing back in the custom code block in On Submit works, but if I put php code inside the custom element it always comes out with { } ???
trunky
I simply try to read a number from a textfile (and decrease it when someone has filled the form). The writing back in the custom code block in On Submit works, but if I put php code inside the custom element it always comes out with { } ???
trunky
This topic is locked and no more replies can be posted.