Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 12-09-2007, 05:14 AM Javascript & PHP
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
I have a problem, im making the team selection for my footie game but what i want to be able to do is list all of the players which i have done. But i want to be pick a goalkeeper and then disable all other goalkeepers until the one i picked has been click again. Bearing in mind there will be a various number of goalkeepers!
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
 
Register now for full access!
Old 12-09-2007, 07:17 AM Re: Javascript & PHP
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
ive had a go myself but the code doesnt seem to uncheck all the boxes after ive checked one and disabled the rest.

PHP Code:
<script language="javascript">
function DoTheCheck() {
<?php 
 $sql 
mysql_query("SELECT * FROM `manager__players` WHERE `team_id` = '" $_SESSION['team_id'] . "' && `position` = 'GK'");
  while(
$row mysql_fetch_array($sql))
  { 
  echo 
"if(document.myform.player_" $row['player_id'] . " .checked == true) {";
   
$dis mysql_query("SELECT * FROM `manager__players` WHERE `team_id` = '" $_SESSION['team_id'] . "' && `position` = 'GK' && `player_id` != '" $row['player_id'] . "'");
   while(
$row2 mysql_fetch_array($dis))
   {
  echo 
"document.myform.player_" $row2['player_id'] . ".disabled = true; ";
  } 
  echo 
"}";
  
  echo 
"if(document.myform.player_" $row['player_id'] . ".checked == false) {";
  
$dis mysql_query("SELECT * FROM `manager__players` WHERE `team_id` = '" $_SESSION['team_id'] . "' && `position` = 'GK'");
   while(
$row2 mysql_fetch_array($dis))
   {
  echo 
"document.myform.player_" $row2['player_id'] . ".disabled = false; ";
  } 
  echo 
"}";
  }  
  
?>
  }
</script>
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Reply     « Reply to Javascript & PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14419 seconds with 12 queries