cancel
Showing results for 
Search instead for 
Did you mean: 

Radio button validation

former_member553808
Participant
0 Kudos

Hi,

I have 2 radio buttons.

If I select one radio button, 3 additional columns to shud appear extra. If other button is selected, those 3 columns should get hidden in the table.

How to handle this?

I have used function call in html code of radio button, but the selected radio button is not being returned back to ABAP from java script.

I have referred to older threads. But in my case, this.sumbit.form() has to be called after selecting the radio button because additional columns have to be displayed

request->get_form_field() works only in Oninput ptocesssing block .

But I have to reload the page to dispaly additional columns.

also, how do I invoke both script function call and oninput processing at the cleck of radio button

please help.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member233090
Active Contributor
0 Kudos

Hi

suppose you have taken 2 radio button as

1 yes

2 no.

and if i click on first radio button you want to add some new coloumns , and whn i change it to 2 then that should be in invisible and another set of coloumns you want to display rite... so on

oninput processing

DATA: event TYPE REF TO CL_HTMLB_EVENT.

event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).

IF event->name = 'radioButton' AND event->event_type = 'click'.

DATA: radiobutton_event TYPE REF TO CL_HTMLB_EVENT_RADIOBUTTON.

radiobutton_event ?= event.

or

DATA: selection type string.

selection = request->get_form_field( NAME = 'Yes' ).

  • then here if the selection contains 'Yes' then set a flag

if selection = 'Yes'.

Flag = 'X'. 'Use this flag in the BSP layout

elseif selection = 'No'.

flag = 'Y'. 'another flag in the bsp layout

ENDIF.

your BSP layout page

If Flag = 'X'.

then add the coloumns which you want to display

else

nothing.

similarly do it for flag Y.

Hope it helps

Cheers,

bhavana