581
Views
6
Comments
Is it possible to apply client side validation in radio button?
Question

How to create client-side validation in radio button control.

Please help...

AV

Thanks

2023-07-28 17-00-32
Marco Arede
 
MVP

Hi Amit Verma,

Yes is possible to validate client side, however you need to do your code for this (something like):

        function ValidRadioButtons() {
            "foreach radio button"
            "if no selected return false"
        }

Then in extended properties of radio button, set onchange to call your javascript method:

Regards,

2024-02-16 07-43-18
Amit Verma

Marco Arede wrote:

Hi Amit Verma,

Yes is possible to validate client side, however you need to do your code for this (something like):

        function ValidRadioButtons() {
            "foreach radio button"
            "if no selected return false"
        }

Then in extended properties of radio button, set onchange to call your javascript method:

Regards,

Hello Marco Arede,

Thanks for reply.

Can i apply CSS to indicate this is mandatory field same like input textbox. (e.g red or any other indicator)

Thanks,

AV



2023-07-28 17-00-32
Marco Arede
 
MVP

You can set Style Classes for a radio button, but to explain is mandatory, I'd just place a star nearby (in text maybe).

2024-02-16 07-43-18
Amit Verma

Marco Arede wrote:

You can set Style Classes for a radio button, but to explain is mandatory, I'd just place a star nearby (in text maybe).

Hi Macro,

Without javascript any other way....

Thanks,

AV



2023-07-28 17-00-32
Marco Arede
 
MVP

Amit Verma, OutSystems does not have an incorporated client validation for radio buttons.

2014-10-21 20-15-17
Alberto Ferreira

Hello Amit,


Why you need that the validation must be done in client side?

Regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.