In my Drupal 7 module, I have a form and its validation handlers. I call my form from a field.tpl.php with
print render(drupal_get_form('my_form')); it works as expected.
The problem is in case of wrong input value.
It requires two incorrect submissions before displaying the error message: The first time, there is red border around my wrong input, and the second time, the error message is displayed (with the red border).
So, what's the right way to use