I have a form to edit bills. A preHook loads the bill data into the form fields.
The form has a normal submit button to save the edited bill, and other technically submit buttons for adding and deleting items on the bill. At the moment I am building the action behind the latter buttons.
I am using &submitVar to identify the buttons - that seems to work. I want FormIt to reload the form, so that the bill data gets refreshed and the user can add or delete another item or save the bill and go on.
But I can't find a way to access the bill's id when the form gets reloaded. Note that I had gotten the id via a GET parameter at the outset, but I can't set this parameter as part of the redirect target AFAIK.
I found FormItRetriever and hoped that $modx->getPlaceholder would be an option, but FormIt doesn't use these placeholders. Neither does $hook->getValue work - returns nothing. But note that the other form fields are correctly prefilled because FormIt's internal method of setting prefixed placeholders is working.
How to do that? Or, better yet, is there a way to pass the bill's id without using GET in general?
EDIT: I even tried $scriptProperties['fields']['billid'] after finding
https://forums.modx.com/thread/47581/question-about-accessing-fields-in-custom-hook but even that just comes out empty.
EDIT #2: I even tried just setting the bill's id in a standard placeholder. But either code in a hook is unable to set placeholders or code in a preHook is unable to get them. Maybe setting the value to a system setting will work???
Thanks for your help!
[ed. note: neo2.0 last edited this post 14 years, 1 month ago.]