Skip to Content Skip to Menu

Documentation for client-side validation API?

3 hours 39 minutes ago #343677 by BobBriscoe
I have been trying to write javascript to integrate the International Phone Input field ( intl-tel-input ) into CB for my site. Despite searching high and low, I can't find any documentation for CB's validator API. Is there any? If not, at least an example script?

I've tried using the documentation for joomla's client-side validation, but CB seems to override that, and work very differently.

Specifically, I'm trying to integrate the nice interactive error feedback of intl-tel-input into CB. I got it working in isolation (outside CB) within a few minutes. I've found code snippets in various CB forum posts that have got me part-way there. But I've been trying to guess code for days now and only occasionally hitting on the right answer to progress a little further each time.

I can at least register the validator, and detect that validation has failed. But I still haven't found how to do things like:
  • block submission when there's an error
    • (I've tried to mimic classes I see appearing when I type invalid input caught by the browser, e.g. required field empty); 
  • make the error message appear under an incorrectly typed field
    • I've tried mimicking the way error messages appear under the field when I force the browser to detect an error
    • but the div doesn't open up, even though I've written the error message into it and changed its display and error properties so that it should
I'm not asking for direct help solving these problems (at least not yet). I'm just asking where the documentation is so I can try to solve them myself without having to guess.

Joomla 5.4.4; CB 2.11.0

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum