473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

need help with radiolist and checkboxlist in javascript

I have an asp.net page that has one radiolist (called lstcheck) and one checkboxlist (call lstExchange). Depending on the which radiolist item is checked, I need to clear the checkbox list or check them all. I have this function so far but it is not working:

Expand|Select|Wrap|Line Numbers
  1. function checkAll()
  2. {
  3.      var radiolist=document.getElementById("lstCheck");
  4.      var checklist=document.getElementById("lstExchange");
  5.  
  6.  
  7.         if (radiolist[3].checked=true)
  8.           {
  9.               for (var j=0; j<checklist.lenght; j++)
  10.                 {
  11.                    checklist[j].checked=true;
  12.                 }
  13.            }
  14.  
  15. }
  16.  
  17.  
  18.  
I add this line to pageload event on the vb side:

lstCheck.Attributes.Add("OnClick", "checkAll();")
Feb 11 '08 #1
4 2148
scripto
143 100+
try this

if (radiolist[3].checked==true)
{
for (var j=0; j<checklist.lenght; j++)
{
checklist[j].checked=true;
Feb 11 '08 #2
I keep getting:

"Object doesn't support this property or method" error
Feb 11 '08 #3
this should be straight forward but it does not seem to be working:

Expand|Select|Wrap|Line Numbers
  1. function function_checkall()
  2. {
  3.  
  4. var chk=document.getElementById("form1");
  5. var chk1=chk.lstExchange;
  6. var chk2=chk.btnRadio100;
  7.     if (chk2.checked ==true ){
  8.  
  9.         for (i=0; i<26; i++)
  10.            {
  11.               chk1[i].checked=true;
  12.            }
  13.     }
  14.  
  15. }
Feb 11 '08 #4
acoder
16,027 Expert Mod 8TB
length is spelt incorrectly. Also use document.getElementsByName("lstCheck") to get the radio button list.
Feb 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Itai | last post by:
I am attempting to create an ASP.NET Custom Validator javascript for a checkboxlist control. My goal is to limit the total number of selections to be 1 - 5 at most. My problem is that I get a null...
2
by: Satheesh Babu B | last post by:
hai.. am having a checkboxlist..now how do i get the value of the checkbox that is checked in checkboxlist using javascript? Thanks in advance.... Regards, Satheesh
3
by: Roy | last post by:
The title is self-explanatory, but I'll show you all what I've done thus far. Here's the aspx side of things(trimmed, of course): <form name="form1" id="Form1" method="post" runat="server">...
4
by: MattB | last post by:
I have a CheckBoxList that under some circumstances I want to only allow one selection, so that if you select a different item, whatever was selected before becomes un-selected. Any ideas on how...
2
by: adeelanjum2001 | last post by:
i am using radiolist box control in my page. when i disable radiolist box when page is displayed first time, that is not ispostback, and when i try to enable it with my javascript code afterwards,...
6
by: Diego_Atos | last post by:
Hi you all. I've an asp.net control, a checkboxlist. I want to read "checked" properties for all items of my control. How can i do it? I read some tips on the net, but none of them works. ...
2
by: Stimp | last post by:
I have a checkboxlist (chkMyList) which is created from a (name, value) pair from a database table. I have a read-only textbox which will be used to hold a total of all the numerical values of...
2
by: Bart Van Hemelen | last post by:
The situation: I have a CheckBoxList cblTest, the items are disabled in cblTest_DataBound in a foreach (ListItem oItem in cblTest.Items) loop. I provide a link that calls a client-side JavaScript...
4
by: haresh.amis | last post by:
hello to all, I m using .net 2.0 and i face a problem that is as under Well I have a checkboxlist which i bound in .cs page now I want to count that how many checkboxes ate checked ( In...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.