Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Posts
    2

    Unanswered: Logic to check for more than one checkbox

    How do I write

    if check_box = 'Y' and > 1 then....

    I want to go a block and save depending on if only one checkbox is checked
    or more than one.

    thx.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    As every checkbox is a separate item, you'll need to check each of them separately, count how many of them have been checked and do whatever you want to do. Unfortunately, I don't know a "smart" way to do that but boring
    Code:
    declare
      l_cnt number := 0;
    begin
      if checkbox_checked('cb_one') then
         l_cnt := l_cnt + 1;
      end if;
    
      if checkbox_checked('cb_two') then
         l_cnt := l_cnt + 1;
      end if;
    
      etc.
    
      if checkbox_checked('one_of_your_checkboxes') and l_cnt > 1 then
         do_something;
      else
         null;
      end if;
    end;

  3. #3
    Join Date
    Oct 2008
    Posts
    2

    Talking

    great....thxs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •