我怎樣才能得到所有選擇的歌曲,當我點擊playselected按鈕,而不選擇任何歌曲?當我點擊playselected時如何選擇所有歌曲?
</style>
<script language=JavaScript>
function checkall()
{
void(d=document);
void(el=d.getElementsByName('song[]'));
for(i=0;i<el.length;i++)
void(el[i].checked=1)
}
function uncheckall()
{
void(d2=document);
void(e2=d2.getElementsByName('song[]'));
for(i=0;i<el.length;i++)
void(el[i].checked=0)
}
</script>
<form method="post" action="/player.php" target="player">
<table width="747" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" rowspan="6" valign="top">
</td>
<td height="120" colspan="3" align="center" valign="top"></td>
<td width="176" rowspan="6" valign="top"></td>
</tr>
<tr>
<!-- movie name -->
<td width="179" height="150" align="center" valign="top"><h3><font color="#008080">moviename</font></h3>
<!-- movie Description start (add description in between these tags)-->
<pre>
</pre> <!-- movie Description end-->
</td>
<td colspan="2" valign="top"><img src="/images/moviename.jpg"></td>
</tr>
<tr>
<td width="179" height="44" align="center"><input type=submit value="Play Selected" /></td>
<td width="86"><input type=button onClick="checkall()" value="Select All" name="button"></td>
<td width="156"><input type=button onClick="uncheckall()" value="Invert Selection" name="button"></td>
</tr>
<tr>
<td colspan="3" valign="top"><table height="342" cellspacing="0" cellpadding="0" border="0" width="423" class="VERDANAFONT">
<tbody>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_1 ,/telugusongs/moviename/0_1.mp3" />
<!-- song names -->
0_1 <br />
</font></p></td>
</tr>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_2 ,/telugusongs/moviename/0_2.mp3" />
<!-- song names -->
0_2 <br />
</font></p></td>
</tr>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_3 ,/telugusongs/moviename/0_3.mp3" />
<!-- song names -->
0_3 <br />
</font></p></td>
</tr>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_4,/telugusongs/moviename/0_4.mp3" />
<!-- song names -->
0_4<br />
</font></p></td>
</tr>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_5 ,/telugusongs/moviename/0_5.mp3" />
<!-- song names -->
0_5 <br />
</font></p></td>
</tr>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_6 ,/telugusongs/moviename/0_6.mp3" />
<!-- song names -->
0_6<br />
</font></p></td>
</tr>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_7 ,/telugusongs/moviename/0_7.mp3" />
<!-- song names -->
0_7 <br />
</font></p></td>
</tr>
<tr>
<td width="423" height="38" align="left" valign="middle"><p> <font color="#339966">
<input type="checkbox" name="song[]" value="0_8 ,/telugusongs/moviename/0_8.mp3" />
<!-- song names -->
0_8 <br />
</font></p></td>
</tr>
</tbody>
</table></td>
</tr>
</table>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
</tr>
</table>
我解釋清楚...當用戶選擇一首歌曲,如果點擊playselect按鈕形式將發佈一首歌曲。這是工作完美。但是,當用戶因此未選擇任何一首歌曲任,如果他點擊playselected按鈕,在這種情況下,我希望所有的歌曲被選中
你想讓你的遊戲選擇按鈕,選擇所有歌曲適合你? – TStamper 2009-10-27 12:01:37
是的,只有當沒有歌曲被選中 – musicking123 2009-10-27 12:08:48
讓我知道它是如何工作的 – TStamper 2009-10-27 19:25:27