2

When an image upload fails validation an error message is thrown on the form, when I then upload an image that passes validation, the previous error message is not cleared from the form. How is this accomplished? Thanks.

1

The reason being after you enter the value the form needs to be submitted for the error to clear out. So if you want the validation removed as the user starts entering values you should look into the Clientside Validation module.

| improve this answer | |
1

This is a core issue with Drupal 7 . You can find a solution in the following link http://drupal.org/node/1792032

| improve this answer | |
0

I think you should look at drupal_set_message().

| improve this answer | |
0

In my case I was doing some additional validations on user registration form (user_register_form) and in case of errors using form_set_error('field_name', t($preparederrmsg)) which all worked very fine.

Problem began when the form had no errors but the old messages were still there and the solution was to render the form again.

    function mymodulename_form_submit_handler($form, &$form_state){
     //all my code here 
     $output = drupal_render($form);
     return $output;
     }
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.