The drop-down box controls Div display and hide
<% @ Page Language = "Java" contenttype = "text/html; charset = gb2312" Import = "Java. SQL. *" %>
<JSP: usebean id = "DB" class = "com. pp. DB. dboperation"> </jsp: usebean>
<%
String Path = request. getcontextpath ();
String basepath = request. getscheme () + ": //" + request. getservername () + ":" + request. getserverport () + path + "/";
%>
<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
<HTML>
<Head>
<Base href = "<% = basepath %>">
<Title> my JSP 'change. jsp 'starting page </title>
</Head>
<Body>
<SCRIPT type = "text/JavaScript">
Function seltype (select)
{
VaR id = select. Options [select. selectedindex]. value;
If (ID = 2)
{
Document. getelementbyid ("nopic"). style. Display = "NONE ";
}
If (ID = 1 | id = 3)
{
Document. getelementbyid ("nopic"). style. Display = "Block ";
}
}
</SCRIPT>
<Select size = 1 name = type_id onchange = "seltype (this)">
<Option value = "1"> 1 </option>
<Option value = "2"> 2 </option>
<Option value = "3"> 3 </option>
</SELECT> *
<Tr id = adstype_file style = "display: Block">
<TD> upload images/Animations (this item is not required if the ad type is pop-up window) <br> </TD>
<TD> <Div id = "nopic"> <br>
Upload images/animations: <input type = "file" name = "pic">
<Br> or directly enter the image address on the network below <br>
<Input class = "input2" id = "FILENAME" maxlength = "100" size = "50" name = "FILENAME"> <font
Color = Red> note </font>: the format of the uploaded file can be/jpg/GIF/BMP/PNG/SWF. The file size cannot exceed 200 kb.
</Div> </TD> </tr>
</Body>
</Html>