By nhero on
I have created a image upload module based on http://www.akchauhan.com/create-image-upload-field-using-drupal-form-api/
I have added a hook_block so I can use this as a block on multiple pages. When a validation error occurs the error shows at the top of the page but I would like the error to be placed within the block. How would I do this?
Comments
You will need to use
You will need to use javascript to do this. Instead of putting the error text out (I assume you are using form_set_error), you would want to put the error text into the drupal settings variable. and then use some javascript to output it. Here is a quick example.
HTML:
PHP code:
JS Code:
thanks, I see that the errors
thanks, I see that the errors are now in $errors.
I couldn't get your js to work so I just did this:
and this for the js
I would like to understand what you wrote though and I was wondering if you knew where to look for a tutorial.
Also
Also http://drupal.org/project/usage/inline_messages and http://drupal.org/project/better_messages are worth a look.
gpk
----
www.alexoria.co.uk