Lists the selected values in the table dynamically based on the checkbox selected

Source: Internet
Author: User
Dynamic


<style>
p,div,body,td,input,checkbox,button{font-size:9pt;}
</style>
<script language= "VbScript" >

function Vbtrim (str)
Vbtrim=trim (str)
End Function

function Vbisnumeric (IVar)
Vbisnumeric=not IsNumeric (IVar)
End Function

</script>
<script language= "JavaScript" >
<!--
var chkval=new Array ();
var curstr = 0;

function CheckTable ()
{
if (typeof (form1.wtfs.length) = = "undefined") alert (' Insufficient number to continue. '); One Checkbox err
wtab.style.visibility= "visible"; Display table
var wtfsmc= "";
Chkval[curstr]= "";
for (i=0;i<form1.wtfs.length;i++)
{
if (form1.wtfs[i].checked)
{
Wtfsmc+=vbtrim (Form1.wtfs[i].nextsibling.nodevalue) + ",";
Chkval[curstr]+=vbtrim (Form1.wtfs[i].value) + ",";
Form1.wtfs[i].checked=false;
form1.wtfs[i].disabled=1;
}
}

if (wtfsmc!= "")
{wtfsmc=wtfsmc.substring (0,wtfsmc.length-1)
Chkval[curstr]=chkval[curstr].substring (0,chkval[curstr].length-1)
ADDTR (WTFSMC,CURSTR);
curstr++;
}
}

function Addtr (mc,iindex)
{
Wtfsmc=obj.nextsibling.nodevalue; Text behind a checkbox
Irow=wtab.rows.length;
if (irow==1)//Xuhao value
{
Xuhao=1
}
Else
{
Xuhao=parseint (Wtab.rows[irow-1].cells[0].innertext) +1;
}
if (form1.ynlj.checked)//whether
{
Shifou= "<font color=green> is a </font>";
}
Else
{
shifou= "<font color=blue> no </font>";
}
Czuo= "[<a href=# onclick= ' Javascript:deltab (" +iindex+ ", Event.srcElement.parentElement.parentElement.rowIndex) ' > Delete </a>] ';
Mynewrow =wtab.insertrow (); Insert TR Row
For (J=0 J <wtab.rows (iRow-1). Cells.length; j + +)
{
Mynewcell = Wtab.rows[irow].insertcell (j); Insert TD CECLL of TR Collection
Switch (j)
{
Case 0:
Wtab.rows[irow].cells (j). InnerHTML = xuhao+ ""; Wtab.rows[irow].cells (j). Align= "Right";
Break
Case 1:
Wtab.rows[irow].cells (j). InnerHTML = "" +MC; Wtab.rows[irow].cells (j). Align= "Left";
Break
Case 2:
Wtab.rows[irow].cells (j). InnerHTML = "" + Shifou; Wtab.rows[irow].cells (j). Align= "Left";
Break
Case 3:
Wtab.rows[irow].cells (j). InnerHTML = Czuo; Wtab.rows[irow].cells (j). align= "center";
Wtab.rows[irow].cells (j). attachevent (' onmouseover ', setcolor_1);
Wtab.rows[irow].cells (j). attachevent (' onmouseout ', setcolor_2);
Break
}
}
}

function Deltab (chkid,iindex)
{
Wtab.deleterow (Iindex);
for (i=0;i<chkval[chkid].length;i++)
{
if (Chkval[chkid].substr (i,1)!= ",")
{
Idx=parseint (Chkval[chkid].substr (i,1));
for (j=0;j<form1.wtfs.length;j++)
{
if (FORM1.WTFS[J].VALUE==IDX)
{
Form1.wtfs[j].disabled=0;
}
}
}
}
}

function setcolor_1 ()
{
var td=event.srcelement;
Td.bgcolor= "#0099FF";
return true;
}

function setcolor_2 ()
{
var td=event.srcelement;
Td.bgcolor= "";
return true;
}
-->
</script>
<form name=form1>
<table border= "1" width= "100%" bordercolorlight= "#006699" cellspacing= "0" bordercolordark= "#FFFFFF" >
<tr>
&LT;TD width= "100%" >
<div align= "center" >
<center>
<table border= "0" width= "98%" cellspacing= "0" cellpadding= "2" >
<tr>
&LT;TD width= "100%" colspan= "3" ></td>
</tr>
<tr>
&LT;TD width= "rowspan=" 7 "bgcolor=" #EEEEEE "style=" border:1 solid #D8D8D8 "> <br>
</td>
&LT;TD colspan= "2" width= "100%" > <font class= "navpoint" >4</font> <b> current selection mode: </b><font Color=red> Transaction amount </font> <font class= "Navpoint" >4</font> <b> way Name: </b><font Color=blue>sdasd</font></td>
</tr>
<tr>
&LT;TD colspan= "2" align= "left" width= "100%" >
&LT;HR width= "1" size= color= "#808080" >
</td>
</tr>
<tr>
&LT;TD width= "2%" ></td>
&LT;TD width= "98%" rowspan= "5" valign= "Top" >
<table border= "0" width= "100%" cellspacing= "0" cellpadding= "2" bgcolor= "#fffffa" >
<tr>
&LT;TD width= "66%" ><fieldset><table border= "0" width= "100%" cellspacing= "0" cellpadding= "0" >
<tr>
&LT;TD width= "33%" >
<input type= "checkbox" value= "0" name= "wtfs" > Inexplicable </td>
&LT;TD width= "33%" >
<input type= "checkbox" value= "1" name= "Wtfs" > Mess </td>
&LT;TD width= "34%" >
<input type= "checkbox" value= "2" name= "Wtfs" > Keypad </td>
</tr>
<tr>
&LT;TD width= "33%" >
<input type= "checkbox" value= "3" name= "WTFS" > Phone number </td>
&LT;TD width= "33%" >
<input type= "checkbox" value= "4" name= "Wtfs" > Let me Do it </td>
&LT;TD width= "34%" >
<input type= "checkbox" value= "5" name= "Wtfs" > Self-Service fast food </td>
</tr>
<tr>
&LT;TD width= "33%" >
<input type= "checkbox" value= "6" name= "Wtfs" > Other delegates </td>
&LT;TD width= "33%" >
<input type= "checkbox" value= "7" name= "WTFS" > Remote access </td>
&LT;TD width= "34%" >
<input type= "checkbox" value= "8" name= "Wtfs" > Dawn Daybreak </td>
</tr>
<tr>
&LT;TD width= "33%" >
</table></fieldset></td>
&LT;TD width= "34%" Valign=top><fieldset><input type= "checkbox" value= "0" name= "YNLJ" > calculated by cumulative turnover <br ><br> <br>< Table border= "0" width= "20%" cellspacing= "0" cellpadding= "0" ><tr><td width= "100%" height=6></td ></tr></table></fieldset></td>
</tr>
<tr>
&LT;TD width= "100%" colspan= "2" >
<div align= "center" >
<center>
<table id=wtab border= "1" width= "99%" cellspacing= "0" bordercolorlight= "#336699" bordercolordark= "#FFFFFF" cellpadding= "1" style= "Visibility:hidden" >
<tr bgcolor= #F9E486 >
&LT;TD width= "10%" align= "center" > Serial number </td>
&LT;TD width= "40%" align= "center" > Delegate Way </td>
&LT;TD width= "30%" align= "center" > whether calculated by cumulative turnover </td>
&LT;TD width= "30%" align= "center" > Operation Options </td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
&LT;TD width= "2%" ></td>
</tr>
<tr>
&LT;TD width= "2%" ></td>
</tr>
<tr>
&LT;TD width= "2%" ></td>
</tr>
<tr>
&LT;TD width= "2%" ></td>
</tr>
<tr>
&LT;TD colspan= "3" width= "100%" >
</td>
</tr>
<tr>
&LT;TD width= "100%" colspan= "3" align=right>
<table border= "0" width= "80%" cellspacing= "0" >
<tr>
&LT;TD width= "34%" align= "right" ><input class= "Hand" button "type=" << Step "value=" style= border:1 #1D 1D1D "></td>
&LT;TD width= "23%" ><input class= "Hand" type= "Submit" value= "Next >>" style= "border:1 solid #1D1D1D" >< /TD>
&LT;TD width= "43%" > <input class= "Hand" type= "button" value= "Close Window" style= "border:1 solid #1D1D1D" ></td>
</tr>
</table><br>
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</form>




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.