JAVAEOC
10-25-2003, 02:51 PM
<HTML>
<HEAD>
<script>
var i=0;
var A=0
function MusicNum(){
if(document.Form1.box0.checked==true){i+=1;};
if(document.Form1.box1.checked==true){i+=1;};
if(document.Form1.box2.checked==true){i+=1;};
if(document.Form1.box3.checked==true){i+=1;};
if(document.Form1.box4.checked==true){i+=1;};
if(document.Form1.box5.checked==true){i+=1;};
};
function Music(){
if(i==1){
if(document.Form1.box0.checked==true){document.write("<EMBED SRC=A.wma hidden=true>")};
if(document.Form1.box1.checked==true){document.write("<EMBED SRC=A.wma hidden=true>")};
if(document.Form1.box2.checked==true){alert("You chose 3");};
if(document.Form1.box3.checked==true){alert("You chose 4");};
if(document.Form1.box4.checked==true){alert("You chose 5");};
if(document.Form1.box5.checked==true){alert("You chose 6");};
}
else{alert("Please check one box, one and only one!!!!!")};
};
function Reset(){
i=0;
};
function All(){
MusicNum();
Music();
Reset();
};
</script>
</HEAD>
<BODY>
<FORM NAME=Form1>
<INPUT TYPE=CHECKBOX NAME=box0>
<INPUT TYPE=CHECKBOX NAME=box1>
<INPUT TYPE=CHECKBOX NAME=box2>
<INPUT TYPE=CHECKBOX NAME=box3>
<INPUT TYPE=CHECKBOX NAME=box4>
<INPUT TYPE=CHECKBOX NAME=box5>
</FORM>
<INPUT TYPE="button" value="get music" onClick=All()>
</BODY>
</HTML>
Here in the function Music() when i tell it to dcument.write("<embed src=a.wma>") it works and it also embeds it but it deletes all the other contend why and how cna i fix this????
<HEAD>
<script>
var i=0;
var A=0
function MusicNum(){
if(document.Form1.box0.checked==true){i+=1;};
if(document.Form1.box1.checked==true){i+=1;};
if(document.Form1.box2.checked==true){i+=1;};
if(document.Form1.box3.checked==true){i+=1;};
if(document.Form1.box4.checked==true){i+=1;};
if(document.Form1.box5.checked==true){i+=1;};
};
function Music(){
if(i==1){
if(document.Form1.box0.checked==true){document.write("<EMBED SRC=A.wma hidden=true>")};
if(document.Form1.box1.checked==true){document.write("<EMBED SRC=A.wma hidden=true>")};
if(document.Form1.box2.checked==true){alert("You chose 3");};
if(document.Form1.box3.checked==true){alert("You chose 4");};
if(document.Form1.box4.checked==true){alert("You chose 5");};
if(document.Form1.box5.checked==true){alert("You chose 6");};
}
else{alert("Please check one box, one and only one!!!!!")};
};
function Reset(){
i=0;
};
function All(){
MusicNum();
Music();
Reset();
};
</script>
</HEAD>
<BODY>
<FORM NAME=Form1>
<INPUT TYPE=CHECKBOX NAME=box0>
<INPUT TYPE=CHECKBOX NAME=box1>
<INPUT TYPE=CHECKBOX NAME=box2>
<INPUT TYPE=CHECKBOX NAME=box3>
<INPUT TYPE=CHECKBOX NAME=box4>
<INPUT TYPE=CHECKBOX NAME=box5>
</FORM>
<INPUT TYPE="button" value="get music" onClick=All()>
</BODY>
</HTML>
Here in the function Music() when i tell it to dcument.write("<embed src=a.wma>") it works and it also embeds it but it deletes all the other contend why and how cna i fix this????