Hi there,
How can I add some classes to the error messages, besides .gfield_error ?
Hi there,
How can I add some classes to the error messages, besides .gfield_error ?
As far as I know, you can't change this. Can you explain why it would be needed? Is .gfield_error not enough for some reason?
Is there some reason you can't add your own customised CSS for the error class to your themes style sheet.
The only other solution I can think off is that you could add additional classes using the jQuery addClass method, so the following example would add the class .mynewclass to any element that is assigned the class .gfield_error
<script>
$(document).ready(function(){
$('.gfield_error').addClass('mynewclass');
});
</script>
Regards,
Richard
Ok thx !
Best solution would of course to have a filter to do that...
Hey Gravity Team, you already have a couple of filters to add css classes at fields and confirmation button, why not push this a bit further, and make sure every single CSS class added can be customized... A unique filter for all those would be a nice solution, we could have a sort of array mapping the elements and the class they will receive.
By the way, there is quite a few websites talking about this issue already, so I guess I am not alone. And relying on client side code to have correct CSS classes is not that great.
How can I officially add this to suggestion to the user wish list ?
Oh, and I forgot to answer to David:
Many reasons to add some CSS classes... I guess the same ones that made your team add a filter to add some CSS class to other elements in the form.
For it's:
Avoiding big CSS duplicates
Enabling twitter bootstrap classes