former icon indicating copy to clipboard operation
former copied to clipboard

Stop validation messages over writting help text

Open SiCoUK opened this issue 10 years ago • 1 comments

Is there anyway to stop the validation error messages (from laravel) over writting the help text for the field. I believe from a usability point of view the help text should still be present.

Can we not have an additional getError() method as well as the getHelp() method.

Or is there a way to overwrite the getHelp() method and spit out two sets of messages?

Thanks

SiCoUK avatar Feb 12 '16 11:02 SiCoUK

Yes!

If you're using the Bootstrap framework, Former offers two types of help text:

  1. Former::text('foo')->help() (or equivalent, Former::text('foo')->inlineHelp()), and
  2. Former::text('foo')->blockHelp()

Former will only overwrite the first type of help with error messages. So if you would like to show additional help text below the error message, simply use:

Former::text('foo')->inlineHelp('Help that will be replaced')->blockHelp('Help that will not be replaced');

I have updated the documentation to reflect this.

claar avatar May 30 '17 17:05 claar