The drop-down box controls Div display and hide

Source: Internet
Author: User

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>
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.