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 August 3rd, 2004, 02:22 PM
mungbaby mungbaby is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 mungbaby User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to mungbaby
If statement

Hello i wanna know how to use if statements in frontpage using the php coding behind it... i just wanna know how if one checkbox is checked, several others would check itself within the page... understand what im saying? like i have a master check box that says negative, and i want all of the negative box throughout the rest of my page to check to negative... if you have any examples please send thanks

Reply With Quote
  #2  
Old August 3rd, 2004, 03:35 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: If statement

OK, here is a script that I believe will do what you want...
Code:
<html>
<head>
<title>Page title</title>
<script type="text/javascript">
function SelectDeselectAll(objElement,objForm) { 
 	   for (i=0;i<objForm.length; i++){ 
		   if (objForm.elements[i].type=="checkbox") { 
         if (objForm.elements[i].name.substring(0,3)==objElement.name){
				 objForm.elements[i].checked=objElement.checked;
         }
				} 
   	}
}
// -->
</script>
</head>
<body>
<form>
<input type="checkbox" name="negative_1"/>Negative 1&nbsp;<input type="checkbox" name="positive_1"/>Positive 1<br>
<input type="checkbox" name="negative_2"/>Negative 2&nbsp;<input type="checkbox" name="positive_2"/>Positive 2<br>
<input type="checkbox" name="negative_3"/>Negative 3&nbsp;<input type="checkbox" name="positive_3"/>Positive 3<br><br />
<input type="checkbox" name="neg" onClick="SelectDeselectAll(this,this.form)"/>Check/Uncheck negative<br>
<input type="checkbox" name="pos" onClick="SelectDeselectAll(this,this.form)"/>Check/Uncheck positive
</form>
</body>
</html>


The only important thing to know is that the first three letters of the name of the checkboxes must
match the name of the checkbox that does the selection and deselection.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > If statement


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
Stay green...Green IT