Forums

Check HTML field on form submit

kgw 27 Jan, 2025

Hello,

I have in Cronoforms an HTML content with the following 3 radio elements:

  • <input type="radio" name="room" value="b">
  • <input type="radio" name="room" value="c">
  • <input type="radio" name="room" value="d">
  • and the button:
  • <button class="nui button colored slate" name="submitbutton" id="submitbutton" type="submit">submit</button>

I want that when clicking the submit button, it checks if one of the 3 input fields has been selected.

If not, an appropriate message should be displayed.

Unfortunately, I can't manage this, because in HTML content there is no REQUIRED behavior.Thank you in advance for your help!

Max_admin 27 Jan, 2025

why do you use custom HTML for that when you can use a Radio field with the Required behavior directly ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kgw 28 Jan, 2025

I use HTML because for every input field, a tooltip with an image should appear on mouseover. I haven't found this option for radio buttons. Is there a way to do this with them?

Max_admin 28 Jan, 2025

did you try adding HTML in the radios labels:

b=<span data-tooltip="????">Option B</span>

you can replace data-tooltip="????" with whatever parameters required for your tooltips to function

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kgw 30 Jan, 2025

Hello Max,

I have now tried your suggestion, but no tooltip is displayed 🧐

Max_admin 30 Jan, 2025

my code will NOT show a tooltip, I was only suggesting that you use that code in order to have custom HTML in the radios label, the HTML can be whatever you use for tooltips.

but if you want to use the NUI tooltips included with Chronoforms then you can try this code:

b=<span data-popup="" title="tooltip text goes here">B</span>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.