<% @ page Language = "Java" Import = "Java. util. * "pageencoding =" UTF-8 "%>
<%
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 'test. jsp 'starting page </title>
<Meta http-equiv = "Pragma" content = "no-Cache">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
<Meta http-equiv = "Description" content = "this is my page">
<! --
<LINK rel = "stylesheet" type = "text/CSS" href = "styles.css">
-->
</Head>
<Body>
<Form action = "<% = PATH %>/news. do? Method = Add "method =" Post "enctype =" multipart/form-Data ">
<Input type = "hidden" name = "ID" value = "$ {NEWS. ID}">
<Table width = "90%" border = "0" align = "Left" cellpadding = "0" cellspacing = "1" class = "newtable">
<Tr>
<TD colspan = "2" id = "more">
Floor name <input type = "text" name = "name" size = "30" value = "111"> floor description <input type = "text" name = "info" Size = "30" value = "111"> <input type = "button" onclick = "AddFile (); "value =" add ">
</TD>
</Tr>
</Table>
</Form>
<SCRIPT type = "text/JavaScript">
VaR T = 1;
Function AddFile ()
{
VaR parent = Document. getelementbyid ("more ");
VaR BR = Document. createelement ("Br ");
VaR charname = Document. createtextnode ("floor name ")
VaR inputname = Document. createelement ("input ");
VaR charinfo = Document. createtextnode ("floor Introduction ")
VaR inputinfo = Document. createelement ("input ");
VaR button = Document. createelement ("input ");
Inputname. Values = "111 ";
Inputname. type = "text ";
Inputname. Name = "name [" + (T ++) + "]";
Inputname. size = "30 ";
Inputinfo. value = "111 ";
Inputinfo. type = "text ";
Inputinfo. Name = "info [" + (T ++) + "]";
Inputinfo. size = "30 ";
Button. type = "button ";
Button. value = "delete ";
Button. onclick = function ()
{
Parent. removechild (BR );
Parent. removechild (charname );
Parent. removechild (inputname );
Parent. removechild (charinfo );
Parent. removechild (inputinfo );
Parent. removechild (button );
};
Parent. appendchild (BR );
Parent. appendchild (charname );
Parent. appendchild (inputname );
Parent. appendchild (charinfo );
Parent. appendchild (inputinfo );
Parent. appendchild (button );
}
</SCRIPT>
</Body>
</Html>