Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 21st, 2003, 12:21 PM
myraleen myraleen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Ontario, Canada
Posts: 123 myraleen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to myraleen Send a message via AIM to myraleen
Validation - multiple checkboxes, one name

I have a form on a page with multiple checkboxes under one name. The value for them is an ID number.

the checkbox looks like this:

php Code:
Original - php Code
  1.  
  2. echo "<input type='checkbox' name='l_id[]' value='$row[0]'>";


There are also numerous tables with these checkboxes set up for each database in the system where the users are found with ID's.

At the bottom of the tables, there is a button to be clicked, that removes the users who are checked off from the system (logs them out).

The form and the button:

php Code:
Original - php Code
  1.  
  2. //top of form
  3. echo "<form name='logout' method='GET' action='$PHP_SELF' onSubmit='return validate_logout(this)'>";
  4.  
  5. //bottom of form
  6. echo "<input name='submit' type='submit' value='logout'></form>";


Ok... so this is the validation located in a seperate .inc file in Java Script

php Code:
Original - php Code
  1.  
  2. <script>
  3. function validate_logout(form) {
  4.      var submitform = true;
  5.      var errors = "You have errors in the following fields: nn";
  6.      var l_id = eval ("document.forms[0].elements['l_id']");
  7.  
  8.      if(l_id == "") {
  9.           submitform = false;
  10.           errors += "No Users Checkedn";
  11.      }
  12.      if (submitform == false) {
  13.           alert(errors);
  14.           return false;
  15.      }
  16. }
  17. </script>


Now I have tried different things. For instance I know chjecked and false have to be in there somewhere, but it wouldn't work.

Any ideas ?

Thanks.

Reply With Quote
  #2  
Old October 21st, 2003, 01:13 PM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Validation - multiple checkboxes, one name

~~~~~Moved by Postal Cow to the Client Side Forum~~~~~

Reply With Quote
  #3  
Old October 21st, 2003, 04:08 PM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
RE: Validation - multiple checkboxes, one name

:laugh: Cow, Well moved and good desicion!!!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Validation - multiple checkboxes, one name


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway