Suppose you want to give an option to user to select only 5 check boxes from given any number of check boxes in an Oracle Form and if user selects more than 5 than give a message that you can not select more than 5.

For this follow these steps:

Create 10 check boxes in block with name like checkbox1, checkbox2, checkbox3 and so on.

Then write the When-Checkbox-Changed trigger at block level and put the following code in it:

declare
nlabel number := 1;
total_checked number := 0;
begin
 while nlabel <= 10 loop
     if checkbox_checked('block3.CHECKBOX'||nlabel) then
       total_checked := total_checked + 1;
       if total_checked > 5 then
          message('more than 5 selected.');
          copy('N', :System.Cursor_Item);
          exit;
       end if;
     end if;
     nlabel := nlabel + 1;
 end loop;
 raise form_trigger_failure;
end;

相关文章:

  • 2022-12-23
  • 2021-08-27
  • 2021-06-23
  • 2021-10-01
  • 2022-03-10
  • 2021-06-11
猜你喜欢
  • 2022-01-11
  • 2021-07-18
  • 2022-02-27
  • 2022-02-27
  • 2021-09-27
  • 2021-07-16
  • 2021-08-03
相关资源
相似解决方案