Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By numfar85 on
I want to take the content of a textarea and process it with a php function in my module when a user clicks submit in a form.
How do I do this? There doesn't seem to be a #callback attribute to set for the submit button according to the form api, or have I missunderstood?
Comments
I think you need to use a
I think you need to use a submit handler in hook_form_alter
then in the callback you can manipulate the textarea
So you can't add it directly
So you can't add it directly in the form builder function?
Oh, and also I have the
Oh, and also I have the function _molmeth_add_form_submit() which should be run after the callback function if certain requirements are met. Will this be possible to configure in the callback function or somewhere else?
Problem is solved.
Problem is solved.