swtdrms007
Programmer
I have been trying to make a pop up menu but it doesn't seem to work. Please help me.<HTML>
<TITLE>pricelist</TITLE>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
function compute(form){
called=true;
if (form.pgs[0].selected){
pgs_print= "3 Pages [$150]";
pgs_flag=150;
}
if (form.pgs[1].selected){
pgs_flag =200;
pgs_print="5 Pages [$200]";
}
else if (form.pgs[2].selected){
pgs_flag =450;
pgs_print="10 Pages [$450]";
}
//-------Scrolling------//
if (form.scr[0].selected){
scr_flag=0;
scr_print="None [$0]";
}
if (form.scr[1].selected){
scr_flag=50;
scr_print="One [$50]";
}
if (form.scr[2].selected){
scr_flag=100;
scr_print="Two [$100]";
}
if (form.scr[3].selected){
scr_flag=150;
scr_print="Three [$150]";
}
if (form.scr[4].selected){
scr_flag=200;
scr_print="Four [$200]";
}
//-------Guestbook-----------//
if (form.gb[0].selected){
gb_flag=0;
gb_print="None [$0]";
}
if (form.gb[1].selected){
gb_flag=50;
gb_print=" [$50]";
}
//-------Scanned Photos-------//
if (form.scanph[0].selected){
scanph_flag=0;
scanph_print="None [$0]";
}
if (form.scanph[1].selected){
scanph_flag=5;
scanph_print="One [$5]";
}
if (form.scanph[2].selected){
scanph_flag=10;
scanph_print="Two [$10]";
}
if (form.scanph[3].selected){
scanph_flag=15;
scanph_print="Three [$15]";
}
if (form.scanph[4].selected){
scanph_flag=20;
scanp_print="Four [$20]";
}
//-------Animation-------//
if (form.anim[0].selected){
anim_flag=0;
anim_print="None [$0]";
}
if (form.anim[1].selected){
anim_flag=50;
anim_print="One [$50]";
}
if (form.anim[2].selected){
anim_flag=100;
anim_print="Two [$100]";
}
if (form.anim[3].selected){
anim_flag=150;
anim_print="Three [$150]";
}
if (form.anim[4].selected){
anim_flag=200;
anim_print="Four [$200]";
}
//-------Clock-------//
if (form.clock[0].selected){
clock_flag=0;
clock_print="None [$0]";
}
if (form.clock[1].selected){
clock_flag=50;
clock_print=" [$50]";
}
//-------Weather-------//
if (form.weath[0].selected){
weath_flag=0;
weath_print="None [$0]";
}
if (form.weath[1].selected){
weath_flag=25;
weath_print=" [$25]";
}
//----------Pop-Up Menu------//
if (form.popup[0].selected){
popup_flag=0;
popup_print="None [$0]";
}
if (form.popup[1].selected){
popup_flag=50;
popup_print=" [ $50]";
}
//----------Drop-down Menu-------//
if (form.drop[0].selected){
drop_flag=0;
drop_print= "None [$0]";
}
if (form.drop[1].selected){
drop_flag=75;
drop_print="One [$75]";
}
if (form.drop[2].selected){
drop_flag=120;
drop_print="Two [$120]";
}
if (form.drop[3].selected){
drop_flag=150;
drop_print="Three [$150]";
}
if (form.drop[4].selected){
drop_flag=175;
drop_print="Four [$175]";
}
T_Price=pgs_flag+scr_flag+gb_flag+scanph_flag+anim_flag+ clock_flag+weath_flag+pop_flag+drop_flag+;form.T_Price.value=" $ "+ T_Price;
}
function print(form){
if(!called){
compute(form);
}
text = ("<HEAD><TITLE>'WEB WIZZARDS SITE ESTIMATOR'</TITLE></HEAD>"
text = (text +"<BODY BGCOLOR = 'WHITE' ><CENTER><B><FONT SIZE = 4><FONT COLOR=PURPLE>SITE ESTIMATOR</FONT></FONT></B>"
text= (text +"<br></CENTER>"
text=(text+"<hr>"
text=(text+"<TABLE BORDER =0><TR VALIGN=Top><TD VALIGN=Top>"
text=(text+"<B>PAGES<BR>SCROLLING<BR>GUESTBOOK<BR>SCANNED PHOTOS <BR>ANIMATION <BR>CLOCK<BR>POP-UP WINDOW <BR>DROP DOWN MENU<BR>"
text=(text+"</B></TD><TD>"
text=(text+"<B>"+ pgs_print+"<BR>"+scr_print+"<BR>"+ gb_print+"<BR>"+ scanph_print+"<BR>"
text=(text+ anim_print+"<BR>"+clock_print+"<BR>"+ weath_print+"<BR>"+ pop_print+"<BR>"
text=(text+drop_print+"<BR>" );
text=(text+"<TD></TR></TABLE><hr>"
text=(text+"<B><FONT COLOR=RED>Total :</FONT>"+"       $"+T_Price);
text=(text+"<BR><BR><BR><BR><BR><FONT SIZE=-1><FONT COLOR=Blue>To print, choose FILE and PRINT.</FONT></FONT>"
text=(text+"</body></html>"
msgWindow=window.open("","displayWindow","toolbar=no,width=375,height=480,directories=no,status=yes,scrollbars=yes,resize=no,menubar=yes"
msgWindow.document.write(text)
msgWindow.document.close()
</SCRIPT>
</HEAD>
<CENTER>
<FORM method=post>
<TABLE BORDER CELLPADDING="2" border=0>
<CAPTION></CAPTION>
<TR><TD><CENTER><B>PAGES <P></CENTER></B>
<SELECT NAME="pgs">
<OPTION Selected> Select
<OPTION> 3 PAGES [$150]
<OPTION> 5 PAGES [$200]
<OPTION> 10 PAGES [$450]
</SELECT>
</TD>
<TD><CENTER><B>SCROLLING <P></CENTER></B>
<SELECT NAME="scr">
<OPTION Selected> Select
<OPTION> One [$50]
<OPTION> Two [$100]
<OPTION> Three [$150]
</SELECT>
</TD>
<TD><CENTER><B>GUEST BOOK <P></CENTER></B>
<SELECT NAME="gb">
<OPTION> Select
<OPTION> [$50]
</SELECT>
</TD>
</TR>
<TR><TD><CENTER><B>SCANNED PHOTOS</CENTER></B> <P>
<SELECT NAME="scanph">
<OPTION> Select
<OPTION> One [$5]
<OPTION> Two[$10]
<OPTION> Three [$15]
<OPTION> Four [$20]
</SELECT>
</TD>
<TD><CENTER><B>ANIMATION <P></CENTER></B>
<SELECT NAME="anim">
<OPTION> Select
<OPTION> One [$50]
<OPTION> Two [$100]
<OPTION> Three [$150]
<OPTION> Four [$200]
</SELECT>
</TD>
<TD><CENTER><B>CLOCK <P></CENTER></B>
<SELECT NAME="clock">
<OPTION> Select
<OPTION> [$25]
</SELECT>
</TD>
</TR>
<TR><TD><CENTER><B>WEATHER <P></CENTER></B>
<SELECT NAME="weath">
<OPTION> Select
<OPTION> [$25]
</SELECT>
</TD>
<TD><CENTER><B>POP-UP WINDOW <P></CENTER></B>
<SELECT NAME="pop">
<OPTION Selected> Select
<OPTION> [ $50]
</SELECT>
</TD>
<TD><CENTER><B>DROP-DOWN MENU <P></CENTER></B>
<SELECT NAME="drop">
<OPTION Selected> Select
<OPTION> One [$75]
<OPTION> Two [$120]
<OPTION> Three [$150]
<OPTION> Four [$175]
</SELECT>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER CELLPADDING="2">
<TR><TD><center><BR>
<INPUT TYPE="BUTTON" NAME="Price" Value="Update Price" onClick="compute(this.form)">
</center>
<BR>
<INPUT TYPE="text" SIZE=15 NAME="T_Price" value="">
<br></TD><TD>
<INPUT TYPE="BUTTON" NAME="Print_data" Value="Print Preview" onClick="print(this.form)">
</center></TD></TR>
</TABLE>
<P>
</FORM>
<P>
</FORM>
</CENTER>
</FONT>
</body>
</HTML>
<TITLE>pricelist</TITLE>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
function compute(form){
called=true;
if (form.pgs[0].selected){
pgs_print= "3 Pages [$150]";
pgs_flag=150;
}
if (form.pgs[1].selected){
pgs_flag =200;
pgs_print="5 Pages [$200]";
}
else if (form.pgs[2].selected){
pgs_flag =450;
pgs_print="10 Pages [$450]";
}
//-------Scrolling------//
if (form.scr[0].selected){
scr_flag=0;
scr_print="None [$0]";
}
if (form.scr[1].selected){
scr_flag=50;
scr_print="One [$50]";
}
if (form.scr[2].selected){
scr_flag=100;
scr_print="Two [$100]";
}
if (form.scr[3].selected){
scr_flag=150;
scr_print="Three [$150]";
}
if (form.scr[4].selected){
scr_flag=200;
scr_print="Four [$200]";
}
//-------Guestbook-----------//
if (form.gb[0].selected){
gb_flag=0;
gb_print="None [$0]";
}
if (form.gb[1].selected){
gb_flag=50;
gb_print=" [$50]";
}
//-------Scanned Photos-------//
if (form.scanph[0].selected){
scanph_flag=0;
scanph_print="None [$0]";
}
if (form.scanph[1].selected){
scanph_flag=5;
scanph_print="One [$5]";
}
if (form.scanph[2].selected){
scanph_flag=10;
scanph_print="Two [$10]";
}
if (form.scanph[3].selected){
scanph_flag=15;
scanph_print="Three [$15]";
}
if (form.scanph[4].selected){
scanph_flag=20;
scanp_print="Four [$20]";
}
//-------Animation-------//
if (form.anim[0].selected){
anim_flag=0;
anim_print="None [$0]";
}
if (form.anim[1].selected){
anim_flag=50;
anim_print="One [$50]";
}
if (form.anim[2].selected){
anim_flag=100;
anim_print="Two [$100]";
}
if (form.anim[3].selected){
anim_flag=150;
anim_print="Three [$150]";
}
if (form.anim[4].selected){
anim_flag=200;
anim_print="Four [$200]";
}
//-------Clock-------//
if (form.clock[0].selected){
clock_flag=0;
clock_print="None [$0]";
}
if (form.clock[1].selected){
clock_flag=50;
clock_print=" [$50]";
}
//-------Weather-------//
if (form.weath[0].selected){
weath_flag=0;
weath_print="None [$0]";
}
if (form.weath[1].selected){
weath_flag=25;
weath_print=" [$25]";
}
//----------Pop-Up Menu------//
if (form.popup[0].selected){
popup_flag=0;
popup_print="None [$0]";
}
if (form.popup[1].selected){
popup_flag=50;
popup_print=" [ $50]";
}
//----------Drop-down Menu-------//
if (form.drop[0].selected){
drop_flag=0;
drop_print= "None [$0]";
}
if (form.drop[1].selected){
drop_flag=75;
drop_print="One [$75]";
}
if (form.drop[2].selected){
drop_flag=120;
drop_print="Two [$120]";
}
if (form.drop[3].selected){
drop_flag=150;
drop_print="Three [$150]";
}
if (form.drop[4].selected){
drop_flag=175;
drop_print="Four [$175]";
}
T_Price=pgs_flag+scr_flag+gb_flag+scanph_flag+anim_flag+ clock_flag+weath_flag+pop_flag+drop_flag+;form.T_Price.value=" $ "+ T_Price;
}
function print(form){
if(!called){
compute(form);
}
text = ("<HEAD><TITLE>'WEB WIZZARDS SITE ESTIMATOR'</TITLE></HEAD>"
text = (text +"<BODY BGCOLOR = 'WHITE' ><CENTER><B><FONT SIZE = 4><FONT COLOR=PURPLE>SITE ESTIMATOR</FONT></FONT></B>"
text= (text +"<br></CENTER>"
text=(text+"<hr>"
text=(text+"<TABLE BORDER =0><TR VALIGN=Top><TD VALIGN=Top>"
text=(text+"<B>PAGES<BR>SCROLLING<BR>GUESTBOOK<BR>SCANNED PHOTOS <BR>ANIMATION <BR>CLOCK<BR>POP-UP WINDOW <BR>DROP DOWN MENU<BR>"
text=(text+"</B></TD><TD>"
text=(text+"<B>"+ pgs_print+"<BR>"+scr_print+"<BR>"+ gb_print+"<BR>"+ scanph_print+"<BR>"
text=(text+ anim_print+"<BR>"+clock_print+"<BR>"+ weath_print+"<BR>"+ pop_print+"<BR>"
text=(text+drop_print+"<BR>" );
text=(text+"<TD></TR></TABLE><hr>"
text=(text+"<B><FONT COLOR=RED>Total :</FONT>"+"       $"+T_Price);
text=(text+"<BR><BR><BR><BR><BR><FONT SIZE=-1><FONT COLOR=Blue>To print, choose FILE and PRINT.</FONT></FONT>"
text=(text+"</body></html>"
msgWindow=window.open("","displayWindow","toolbar=no,width=375,height=480,directories=no,status=yes,scrollbars=yes,resize=no,menubar=yes"
msgWindow.document.write(text)
msgWindow.document.close()
</SCRIPT>
</HEAD>
<CENTER>
<FORM method=post>
<TABLE BORDER CELLPADDING="2" border=0>
<CAPTION></CAPTION>
<TR><TD><CENTER><B>PAGES <P></CENTER></B>
<SELECT NAME="pgs">
<OPTION Selected> Select
<OPTION> 3 PAGES [$150]
<OPTION> 5 PAGES [$200]
<OPTION> 10 PAGES [$450]
</SELECT>
</TD>
<TD><CENTER><B>SCROLLING <P></CENTER></B>
<SELECT NAME="scr">
<OPTION Selected> Select
<OPTION> One [$50]
<OPTION> Two [$100]
<OPTION> Three [$150]
</SELECT>
</TD>
<TD><CENTER><B>GUEST BOOK <P></CENTER></B>
<SELECT NAME="gb">
<OPTION> Select
<OPTION> [$50]
</SELECT>
</TD>
</TR>
<TR><TD><CENTER><B>SCANNED PHOTOS</CENTER></B> <P>
<SELECT NAME="scanph">
<OPTION> Select
<OPTION> One [$5]
<OPTION> Two[$10]
<OPTION> Three [$15]
<OPTION> Four [$20]
</SELECT>
</TD>
<TD><CENTER><B>ANIMATION <P></CENTER></B>
<SELECT NAME="anim">
<OPTION> Select
<OPTION> One [$50]
<OPTION> Two [$100]
<OPTION> Three [$150]
<OPTION> Four [$200]
</SELECT>
</TD>
<TD><CENTER><B>CLOCK <P></CENTER></B>
<SELECT NAME="clock">
<OPTION> Select
<OPTION> [$25]
</SELECT>
</TD>
</TR>
<TR><TD><CENTER><B>WEATHER <P></CENTER></B>
<SELECT NAME="weath">
<OPTION> Select
<OPTION> [$25]
</SELECT>
</TD>
<TD><CENTER><B>POP-UP WINDOW <P></CENTER></B>
<SELECT NAME="pop">
<OPTION Selected> Select
<OPTION> [ $50]
</SELECT>
</TD>
<TD><CENTER><B>DROP-DOWN MENU <P></CENTER></B>
<SELECT NAME="drop">
<OPTION Selected> Select
<OPTION> One [$75]
<OPTION> Two [$120]
<OPTION> Three [$150]
<OPTION> Four [$175]
</SELECT>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER CELLPADDING="2">
<TR><TD><center><BR>
<INPUT TYPE="BUTTON" NAME="Price" Value="Update Price" onClick="compute(this.form)">
</center>
<BR>
<INPUT TYPE="text" SIZE=15 NAME="T_Price" value="">
<br></TD><TD>
<INPUT TYPE="BUTTON" NAME="Print_data" Value="Print Preview" onClick="print(this.form)">
</center></TD></TR>
</TABLE>
<P>
</FORM>
<P>
</FORM>
</CENTER>
</FONT>
</body>
</HTML>