Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


How to get value of selected dynamic checkboxes?



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> ASP & ASP.NET Forum
View previous topic :: View next topic  
Author Message
frmsasp



Joined: 03 Sep 2005
Posts: 8

PostPosted: Fri Oct 14, 2005 10:19 am    Post subject: How to get value of selected dynamic checkboxes? Reply with quote

Hello there,

Currently I am working with the project which needs dynamically generated checkboxes and i have generated dynamic checkboxes but i am facing problem with getting the vaue of selected checkboxes.

Problem is described below in detail to easily understood, so please let me know if you come to know...

Example:
I am creating a form to assign rights to site admin for managing different module of the site from back end. Please have a look at attached file to better understand the structure of admin rights form which i used.

I had created checkbox dynamically with below statement FOR EACH Module.

lblCheck.Text += "<input type='checkbox' name='chk[" + daDetail["Module_id"] + i.ToString() + "]' value='A'>Add
lblCheck.Text += "<input type='checkbox' name='chk[" + daDetail["Module_id"] + i.ToString() + "]' value='E'>Edit
lblCheck.Text += "<input type='checkbox' name='chk[" + daDetail["Module_id"] + i.ToString() + "]' value='D'>Delete
lblCheck.Text += "<input type='checkbox' name='chk[" + daDetail["Module_id"] + i.ToString() + "]' value='S'>Search

Say my Module_Id = 12

After form submit I got value with
form.querystring["chk121"]; form.querystring["chk122"];
form.querystring["chk123"];
form.querystring["chk124"];

But I want to use foreach loop for getting the values of each selected checkboxes Because there are more then 50 moudles. so please,let me know how to do this? Main problem is that I don't know how many total checkbox generated dynamically, that is why I have to use foreach or for loop.

Any help, advice or pointers on this matter would be highly appreciated.

Thanks,
Paresh

[/img]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> ASP & ASP.NET Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap