User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 402,466 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,926 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1661 | Replies: 4
Reply
Join Date: Aug 2006
Posts: 22
Reputation: yenyen is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
yenyen yenyen is offline Offline
Newbie Poster

checkbox or radio button value cant keep during recordset paging function

  #1  
Jan 24th, 2008
hi everybody. i got a list of checkboxes and radio button with the recorset paging function. let said i got the paging list << 1 2 3 4 5 >>. i set each page is 10 records. and every record got one checkbox for DELETE ID usage. in the first page, i check 5records, then i go to second page, i checked another 5records. but why it cant keep the value for the first page 5records when i go back or go to next pages? hope u all can give me some solution on it.plz help..thank you.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 1,057
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: checkbox or radio button value cant keep during recordset paging function

  #2  
Jan 25th, 2008
you probably set the checkboxes to new values. ASP does not store values for you and everytime you get "new page", they are reset. You have a choice here.. you can, on each page load, store the values in a hidden input value. Then, with asp, search the checkboxes on the page that have that value and check them if they do. If not, they won't be checked. THen under a user submit to delete, grab the value of the hidden variable and put it into an array. Then add the additional checkboxes that are checked on the page to that array, then do a loop to delete.

vuala
Reply With Quote  
Join Date: Jun 2008
Posts: 1
Reputation: elisa23 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
elisa23 elisa23 is offline Offline
Newbie Poster

Re: checkbox or radio button value cant keep during recordset paging function

  #3  
Jun 7th, 2008
Originally Posted by SheSaidImaPregy View Post
you probably set the checkboxes to new values. ASP does not store values for you and everytime you get "new page", they are reset. You have a choice here.. you can, on each page load, store the values in a hidden input value. Then, with asp, search the checkboxes on the page that have that value and check them if they do. If not, they won't be checked. THen under a user submit to delete, grab the value of the hidden variable and put it into an array. Then add the additional checkboxes that are checked on the page to that array, then do a loop to delete.

vuala

hi there vuala

coould you please give a code example

thanks a lot
Reply With Quote  
Join Date: Aug 2007
Posts: 76
Reputation: anto_nee is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 4
anto_nee anto_nee is offline Offline
Junior Poster in Training

Re: checkbox or radio button value cant keep during recordset paging function

  #4  
Jun 7th, 2008
this is not possible as the code example will be very big.. try urself and ask here if u couldnt solve that..
Reply With Quote  
Join Date: Sep 2007
Posts: 1,057
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: checkbox or radio button value cant keep during recordset paging function

  #5  
Jun 7th, 2008
Originally Posted by elisa23 View Post
hi there vuala

coould you please give a code example

thanks a lot



Actually, no lol. If you post your code, I can give you an update code snippet to show you what you need to do.

For this, and most cross-page checks, you have many options, but all options you will need to store the data somewhere.

Options:
1. Use javascript and stay on the same page without going to another page at all. Using javascript (another programming language), you can load all records onto the current page and hide and show certain layers on the page. Thus, every layer is still part of the page, you can keep the elements checked.
2. Create an array after they click to the next page (most efficient and favorable). When they click to goto the next page, loop through all the checkboxes and for those who are checked, add their id's onto the array. Then, store the array in a session variable. (This can be avoided by using server.transfer method, but more coding than is required). On the following page, let them check more boxes. After they click back or next, add those checkbox id's onto the array, and restore it in the session variable. When they finally click delete, just loop through the ID's and delete. But remember, on each page, you will need to check for that session variable, loop through the id's, and check the ones that were checked previously. This isn't a big task, it's actually quite small (depending on how you layer things). Attempt it, and let me know the code to help you.
3. Store the id's in a file. This is very inefficient as if you have 1000 people viewing your site at one time and searching, you will have 1000 files, not to mention the IO (file methods) methods are very costly on your environment.
4. Delete after every page. If they wish to go to the next page, let them know that by leaving the page, they will delete teh selected users (not a user friendly program at all).
5. Don't show them pages, show it all on one page.

Let me know if you have any questions.
Last edited by SheSaidImaPregy : Jun 7th, 2008 at 9:02 pm.
I answer pm's.
I answer questions.
I answer quickly.
I answer.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ASP Forum

All times are GMT -4. The time now is 4:03 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC