Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:25:58+00:00 2026-06-13T19:25:58+00:00

i have <script type=text/javascript language=javascript> function setCheckboxes3(act) { var e = document.getElementsByClassName(‘names’); var elts_cnt

  • 0

i have

<script type="text/javascript" language="javascript">
    function setCheckboxes3(act) {
        var e = document.getElementsByClassName('names');
        var elts_cnt  = (typeof(e.length) != 'undefined') ? e.length : 0;
        if (!elts_cnt) {
            return;
        }
        for (var i = 0; i < elts_cnt; i++) {
            e[i].checked = (act == 1 || act == 0) ? act : (e[i].checked ? 0 : 1);
        }
    }
</script>

<a href="javascript:setCheckboxes3(1);" class="chkmenu">Semua</a> |
<a href="javascript:setCheckboxes3(0);" class="chkmenu">Tidak Satupun</a> |
<a href="javascript:setCheckboxes3(2);" class="chkmenu">Balik Pilihan</a><br />

<input type="checkbox" name="listBidang[1]" class="names" value="1" />Pembinaan<br/>
<input type="checkbox" name="listBidang[2]" class="names" value="1" />Intelijen<br/>
<input type="checkbox" name="listBidang[3]" class="names" value="1" />Pengawasan<br/>
<input type="checkbox" name="listBidang[4]" class="names" value="1" />Pidum<br/>
<input type="checkbox" name="listBidang[5]" class="names" value="1" />Pidsus<br/>
<input type="checkbox" name="listBidang[6]" class="names" value="1" />Datun<br/>

how to display checked or checked in edit data ???
(make array if 0=not checked and if 1=checked)

example 100001

<input type="checkbox" name="listBidang[1]" class="names" value="1" checked="checked" />Pembinaan<br/>
<input type="checkbox" name="listBidang[2]" class="names" value="1" />Intelijen<br/>
<input type="checkbox" name="listBidang[3]" class="names" value="1" />Pengawasan<br/>
<input type="checkbox" name="listBidang[4]" class="names" value="1" />Pidum<br/>
<input type="checkbox" name="listBidang[5]" class="names" value="1" />Pidsus<br/>
<input type="checkbox" name="listBidang[6]" class="names" value="1" checked="checked" />Datun<br/>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:25:59+00:00Added an answer on June 13, 2026 at 7:25 pm

    If a checkbox is not checked it’s key will not appear in the result data. I think a better approach is this:

    <input type="checkbox" name="listBidang[]" value="Pembinaan" checked="checked" />Pembinaan
    <input type="checkbox" name="listBidang[]" value="Intelijen" />Intelijen
    <input type="checkbox" name="listBidang[]" value="Pengawasan" />Pengawasan
    <input type="checkbox" name="listBidang[]" value="Datun" checked="checked" />Datun
    

    Now your data should look like:

    $_GET["listBidang"]; // array("Pembinaan", "Datun");
    

    The empty bracket notation (listBidang[]) will dynamically build the set for you. Omitting any unchecked values.

    If there are no values checked $_GET["listBidang"] will not be set. You might expect an empty array, but alas. So make sure you use isset, empty or array_key_exists to check if it’s there before trying to read it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code <html> <head> <script src=jquery-1.7.2.min.js type=text/javascript></script> <script src=jquery-ui-1.8.20.custom.min.js type=text/javascript></script> <script type
<SCRIPT Language = JavaScript> function calculate() { a = 12 b = eval(document.form.number.value) c
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have this simple jQuery code $(document).ready(function() { $('#test').attr('value','hello world'); $('#test1').text('hello world'); }); And
OK I have a simple script at http://kleague.org/test/ Type a movie name and it
I have a Perl script called replaceUp: #!/usr/bin/perl search=$1 replace=$2 find . -type f
So I have an upload script, and I want to check the file type
I have the following PHP script: <?php $vote_type = $_GET['type']; $book = $_GET['book']; $id
At the moment I have a very simple script. If I type the commands

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.