ASP takes the data from the dynamic form and writes the XML file, which is displayed in the XSL

Source: Internet
Author: User
Tags count return xsl
Xml| News | data | show |xml

1. Dynamic form of the interface, from the CSDN Forum on the reference

<title> Untitled Document </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<script language= "JavaScript" >
var currow=null;
var Y=1;

function SelectRow () {
var e=window.event;
var tr1=e.srcelement;
if (Currow)
Currow.bgcolor= "#FFFFFF";
Tr1.bgcolor= "E7e7e7";
CURROW=TR1;
}
function AddRow (SRC) {
alert (SRC);
var newrow = Src.insertrow (src.rows.length-1);
Newrow.attachevent ("onclick", SelectRow);
newrow.height=20;
var i=4;

while (i--) {
var Newcell = Newrow.insertcell ();

switch (i) {
Case 0:newcell.innerhtml= ' <input type= ' button ' value= ' delete this row ' > ' + (y++);
Document.all.count.value=y-1;
Break
Case 1:newcell.innerhtml=div2.innerhtml;break;
Case 2:newcell.innerhtml=div3.innerhtml;break;
Case 3:newcell.innerhtml=div4.innerhtml;break;
Default:newcell.innerhtml=div1.innerhtml;break;

}
}
alert (newrow.outerhtml);
}

function Delrow (SRC) {

var tab=src.parentelement;
var i=tab.rows.length;
var j=tab.rows.length;
while (i--) {
if (Src==tab.rows[i]) {
Alert ("This is the line----" + i);
document.all.count.value=j-3;
Tab.deleterow (i);

}

}
}
</script>

<body>
<form name= "Form1" action= "2.asp" method= "POST" Onsubmit=return (CHECKV ()) >
Name: <input type= "text" name= "Jxname" ><br>
Address: <input type= "text" name= "Jxadd" ><br>
Tel: <input type= "text" name= "Jxtel" ><br>
Please enter inventory information <br>
<table id= "TB" width= "100%" border= "1" align= "center" cellpadding= "1" cellspacing= "1" style= "Border-collapse: Collapse "bordercolor=" #111111 ">
<tr>
<th scope= "col" width= "25%" > Name </th>
<th scope= "col" width= "25%" > Specifications </th>
<th scope= "col" width= "25%" > Storage </th>
<th scope= "col" width= "25%" > Operations </th>
</tr>
<tr id= "Blankrow" >
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<input type= "hidden" name= "Count" value= "Count" >
<input type= "Submit" id= "Btnsub" name= "Btnsub" value= "submitted" ><br>
</form>
<div id= "Div1" style= "Display:none" ><input "TXT" id= "text" type= "id" name= "style=; Background-color: #FFFFEF "></div>

<div id= "Div2" style= "Display:none" ><input "TXT" id= "text" type= "name=" Id1 "style="; Background-color: #FFFFEF "value=" ></div>
</body>
<div id= "Div3" style= "Display:none" ><select name= "Id2" "style=" width:97%; Background-color: #FFFFEF ">
<option value= "box" > Box </option>
<option value= "Pieces" > Parts </option>

</select></div>
<div id= "Div4" style= "Display:none" ><input "TXT" id= "text" type= "name=" ID3 "style="; Background-color: #FFFFEF "value=" ></div>
<script language= "JavaScript" >
function Checkv ()
{

if (form1.jxname.value.length = 0)
{
Alert ("Please fill in your name and address!") ");
Form1.jxname.focus ();
return false;
}

Else if (!) ( Check_number (Form1.id1.value))
  {
   alert ("Quantity can only be numeric")
Form1.id1.focus ()
return false;
}
Else
return (true);
}
Function Check_number (myint)
{

var Checkok = "0123456789";
var checkstr = Myint;
var allvalid = true;
var decpoints = 0;
var allnum = "";
for (i = 0;  i < checkstr.length; i++)
{
ch = checkstr.charat (i);
for (j = 0;  J < Checkok.length; J + +)
if (ch = = Checkok.charat (j))
Break
if (j = = Checkok.length)
{
Allvalid = false;
Break
}
Allnum + = ch;
}
if (!allvalid)
{
return (false);
}
return (true);
}



Related Article

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.