‎2007 Mar 07 11:50 AM
Hi,
I have a requirement like below I have 1 check box and 1 radio button
Check box
Radio button
Suppose if I select only radiobutton one functionality has to happen, and if I select radio button & check box one functionally has to happen how to write the if condition.
akshitha.
‎2007 Mar 07 11:52 AM
if p_check = 'X'.
WRITE YOUR FUNCTIONALITY IN A PERFORM.
eLSE IF P_CHECK = 'X' AND P_RAD = 'X'.
WRITE THE OTHER FUNCTIONALITY HERE
ENDIF.
THIS LOGIC CAN BE WRITTEN IN START-OF-SELECTION IN A REPORT.
‎2007 Mar 07 12:01 PM
Hi,
When you put in a Radio Button and Check Box make sure of the below,
<b>1.</b> When you are using Radio Button, then you should create a Radio Button Group. And in this Radio Button Group you may have multiple buttons but the fact is that atleast one Radio Button should be selected. So, whats the point in having a single Radio Button.
Coming to the solution,
When you create a radio button and check box you would have assigned some variable name to them. So, use these variable names in the program to write an IF statement.
Say you have named radio button as rbutton and check box as cbox.
<b>Note:</b> When the radio button is elected or check Box is checked then the variables assigned to them will have value 'X'.
The If statement shud all propably be as below,
IF rbutton = 'X' AND cbox = 'X'
Functionality 1.
ELSIF rbutton = 'X'.
Functionality 2.
ENDIF.
3Cheers,
Raga Suman.
‎2007 Mar 07 12:03 PM
hai akshitha...
there is a small modification to the above code..
try this...and let me know the result...
IF IF P_CHECK = 'X' AND P_RAD = 'X'.
WRITE YOUR FUNCTIONALITY IN A PERFORM.
ELSEIF P_CHECK = 'X'.
WRITE THE OTHER FUNCTIONALITY HERE
ENDIF.
But u can not create a radiobutton group with a single radio button... u shuld have atleast 2 radiobuttons in a group...... Check it once..
Suresh......
‎2007 Mar 07 12:18 PM
hi akishitha,
i think single radiobutton is always selected so you have to put condition on check box only . (not sure) pls ckeck it out. but if you have mulptiple radio button then you have to put these in a group. and the condition as :
if radiobutton = ' X ' and checkbox = ' X '.
execute the code
endif.
if checkbox= ' X '.
execute the code
endif.
rgds
Deepak .
‎2007 Mar 08 1:23 AM
Hi,
if rad1 = 'X'.
code..
elseif (chk = 'X' and rad1 = 'X').
code..
endif..
try using 2 radio buttond or 2 checkboxes instead of both radiobutton and chkbox
regards,
keerthi