0

I'm building a "at least one choice required" checkbox group. I know I can use setCustomValidity method in order to display a native like validation message but I want to use the radio validation message in order to take advantage from native internationalisation.

From now, I use the hidden input radio technique to achieve this but I want to know if I can map the native input radio validation message to another input.

Thanks for your clues.

Existe Deja
  • 1,227
  • 3
  • 14
  • 36
  • I believe you can set the browsers default message ([HTML5 form required attribute. Set custom validation message?](https://stackoverflow.com/questions/5272433/html5-form-required-attribute-set-custom-validation-message)) But I don't think it's possible to read the default value you'd need to replace one validation message with another. – DBS Sep 01 '22 at 09:30
  • It's not entirely clear what you are trying to achieve. Why do you need to "map the native input radio validation message to another input."? Why do you need to use an "hidden" input? Can't you just use the original message from the *visible* input? – Kaiido Sep 01 '22 at 09:59
  • Input checkbox group can't be required so there is no validation messages for them. Because the feature I want can have similar validation message as radio button one's, I want to know if I can get them from somewhere. I know about `setCustomValidity` method but I don't want to translate my message in every language as I already know message from radio button is working for my case. – Existe Deja Sep 01 '22 at 13:52

0 Answers0