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 74053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:17:52+00:00 2026-05-10T20:17:52+00:00

I have a checkbox list control on my asp.net web form that I am

  • 0

I have a checkbox list control on my asp.net web form that I am dynamically populating from an arraylist. In javascript I want to be able to iterate through the values in the list and if a particular value has been selected to display other controls on the page.

My issue is that all the values in the checkbox list are showing up as ‘on’ instead of the actual value set. How do I get the actual values for each checkbox?

Thanks.

Javascript:

checkBoxs=document.getElementById(CheckboxList);     var options=checkBoxs.getElementsByTagName('input');             for(var i=0;i<options.length;i++)     {                     if(options[i].value=='Other')         {             if(options[i].checked)             {                 var  otherPub=document.getElementById('<%=alsOtherPublicity.ClientID%>');                 otherPub.style.display='block';              }                         }       } 

Edit: The line that I’m having problems with is if(options[i].value==’Other’) as the values showing up in firebug are given as ‘on’ rather than the values that I set.

Edit 2: The html that is produces looks like:

<span id='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity' class='ucFieldCBL' onChange='alValidate();' onClick='alPublicity('ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity');'>   <input id='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_0' type='checkbox' name='ctl00$ContentPlaceHolderMetadata$Allocation1$alfPublicity$0'/>   <label for='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_0'>Text1</label>   <input id='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_1' type='checkbox' name='ctl00$ContentPlaceHolderMetadata$Allocation1$alfPublicity$1'/>   <label for='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_1'>Text2</label>   <input id='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_2' type='checkbox' name='ctl00$ContentPlaceHolderMetadata$Allocation1$alfPublicity$2'/>   <label for='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_2'>Text3</label>   <input id='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_3' type='checkbox' name='ctl00$ContentPlaceHolderMetadata$Allocation1$alfPublicity$3'/>   <label for='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_3'>Text4</label>   <input id='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_4' type='checkbox' name='ctl00$ContentPlaceHolderMetadata$Allocation1$alfPublicity$4'/>   <label for='ctl00_ContentPlaceHolderMetadata_Allocation1_alfPublicity_4'>Text5</label> </span> 

It looks as if the issue stems from the lack of a value attribute available on the asp.net checkbox control as described by Dave Parslow. I’m currently trying a workaround by calling a function server side to return the text of the checkbox and using that instead.

  • 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. 2026-05-10T20:17:53+00:00Added an answer on May 10, 2026 at 8:17 pm

    I realised after much playing about with prerender events that I didn’t actually need to know the exact value of the checkbox as the arraylist values would be in the same order as the checkboxes. I searched through the arraylist to get the position of the value that I needed and then used that position on the list of checkboxes.

    It sounds a bit fiddly and I don’t know if it would work for everyone but I thought I would put it up here anyway incase it helps someone else someday.

    Thanks for all your help.

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

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I would search all of the files in your solution… May 11, 2026 at 8:54 am
  • added an answer you could use concat. concat [ [(n*2),(n*3)] | n <-… May 11, 2026 at 8:54 am
  • added an answer Have you tried using a mx:List - drag and drop… May 11, 2026 at 8:54 am

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.